Skip to content

Commit

Permalink
Chore: Split linting and tests tasks on Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Sep 29, 2023
1 parent 8578406 commit fcfff67
Showing 1 changed file with 45 additions and 23 deletions.
68 changes: 45 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
name: Node
name: CI
on: [push, pull_request]
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
build:
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'
- run: yarn install --immutable --immutable-cache
- name: Eslint
run: yarn eslint .
- name: Validate package setup
run: |
yarn setup
yarn prettier --write .
git diff --exit-code -- . :^.yarn
Unit:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -10,34 +31,35 @@ jobs:
- 20
- 18
- 16
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install --immutable --immutable-cache
- name: Test packages
run: yarn vitest --run --coverage
- uses: codecov/codecov-action@v3

- name: yarn install
run: yarn install --immutable --immutable-cache

- name: Eslint
run: yarn eslint .
- name: Validate package setup
run: |
yarn setup
yarn prettier --write .
git diff --exit-code -- . :^.yarn
Integration:
name: Typescript & Integration Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 20
- 18
- 16
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install --immutable --immutable-cache
- name: Typescript
run: yarn turbo tsc
- name: Test packages
run: yarn vitest --run --coverage
- name: Integration tests
run: yarn node --test integration/

- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage/clover.xml

0 comments on commit fcfff67

Please sign in to comment.