Skip to content

Commit

Permalink
Add install action and run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
efoken committed Dec 6, 2024
1 parent a1b4139 commit 61ef1e3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 10 deletions.
27 changes: 27 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Install'
description: 'Setup Node.js and install dependencies'

inputs:
node-version:
description: Node.js version

runs:
using: composite
steps:
- name: Setup Node.js
if: ${{ inputs.node-version == '' }}
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'

- name: Use Node.js ${{ inputs.node-version }}
if: ${{ inputs.node-version != '' }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'

- name: Install dependencies
shell: bash
run: yarn install --immutable
21 changes: 12 additions & 9 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,28 @@ on:
branches: [main]

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install

- run: yarn lint

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Install dependencies
uses: ./.github/actions/install
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Get installed Playwright version
run: echo "PLAYWRIGHT_VERSION=$(yarn info playwright --json | jq -r '.children.Version')" >> $GITHUB_ENV
Expand All @@ -41,5 +45,4 @@ jobs:
run: yarn playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- run: yarn lint
- run: yarn test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
2 changes: 1 addition & 1 deletion packages/svg/src/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { ResponderEvent, StyleProp } from '@react-universal/core';
import { createElement, styled } from '@react-universal/core';
import { type AnyObject, isArray, isNumber, isString } from '@react-universal/utils';
import { isArray, isNumber, isString } from '@react-universal/utils';
import { forwardRef } from 'react';
import type {
CircleProps,
Expand Down
3 changes: 3 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export default defineConfig({
resolve: {
conditions: ['source'],
},
define: {
'process.env': process.env,
},
test: {
browser: {
enabled: true,
Expand Down

0 comments on commit 61ef1e3

Please sign in to comment.