From fcfff679415d040aec3937b514592683dea4988a Mon Sep 17 00:00:00 2001 From: Simon Boudrias Date: Mon, 25 Sep 2023 18:08:56 -0400 Subject: [PATCH] Chore: Split linting and tests tasks on Github actions --- .github/workflows/main.yml | 68 +++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36c3d8377..7d0ce093e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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