From d4969fbb0366c13665f3e7caa723295ecceebd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Thu, 13 Oct 2022 02:33:14 +0200 Subject: [PATCH] chore(CI): simplify testing strategy --- .github/workflows/CI.yml | 63 +++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7ed49140..dc3e8908 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,28 +1,68 @@ name: CI on: - push: {} - pull_request: {} + push: + pull_request: + jobs: - main: + lint: + name: ⬣ Lint + runs-on: ubuntu-latest + steps: + - name: 🛑 Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: ⎔ Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: 📥 Install dependencies + run: npm install + + - name: ▶️ Run lint script + run: npm run lint + + test: + name: 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ matrix.os }}) strategy: matrix: - eslint: [7, 8] - node: [12.22.0, 12, 14.17.0, 14, 16, 18] - runs-on: ubuntu-latest + eslint: [8] + node: [12.22.0, 12, 14.17.0, 14, 16.0.0, 16, 18] + os: [ubuntu-latest] + include: + # On other platforms + - os: windows-latest + eslint: 8 + node: 18 + - os: macos-latest + eslint: 8 + node: 18 + # On old ESLint versions + - eslint: 7 + node: 18 + os: ubuntu-latest + # On the minimum supported ESLint/Node.js version + - eslint: 7.0.0 + node: 12.22.0 + os: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.10.1 + uses: styfle/cancel-workflow-action@0.11.0 - name: ⬇️ Checkout repo uses: actions/checkout@v3 - - name: ⎔ Setup node + - name: ⎔ Setup Node v${{ matrix.node }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} cache: npm + node-version: ${{ matrix.node }} - - name: 📥 Download deps + - name: 📥 Install dependencies run: npm ci - name: 📥 Install ESLint v${{ matrix.eslint }} @@ -30,3 +70,6 @@ jobs: - name: ▶️ Run test script run: npm run test -- --runInBand + + - name: ⬆️ Upload coverage report + uses: codecov/codecov-action@v3