From 8e2a9e12f805a21bb22d63f66787a5170bc02216 Mon Sep 17 00:00:00 2001 From: Gauthier Fiorentino Date: Thu, 14 Mar 2024 17:16:09 +0100 Subject: [PATCH 1/3] CI: Adds type checking --- .github/workflows/tests.yml | 2 +- .github/workflows/type-check.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/type-check.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5a09637..c4b8e05 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,6 +15,6 @@ jobs: node-version: 18.12.1 cache: npm - name: Install - run: npm ci + run: npm ci --prefer-offline - name: Run tests run: npm run test:unit diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml new file mode 100644 index 0000000..08c8310 --- /dev/null +++ b/.github/workflows/type-check.yml @@ -0,0 +1,20 @@ +name: 'Run tests' + +on: [push, workflow_dispatch] + +jobs: + type-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: +# TODO: add version to a .nvmrc or at least a variable + node-version: 18.12.1 + cache: npm + - name: Install + run: npm ci --prefer-offline + - name: Type check + run: npm run type-check From 6cfcec8790463b99fa94184f3213e7007a06e151 Mon Sep 17 00:00:00 2001 From: Gauthier Fiorentino Date: Thu, 14 Mar 2024 17:34:45 +0100 Subject: [PATCH 2/3] CI: Test reusable actions --- .github/workflows/CI.yml | 12 ++++++++++++ .github/workflows/build.yml | 2 +- .github/workflows/tests.yml | 2 +- .github/workflows/type-check.yml | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..fd71443 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,12 @@ +name: "CI" + +on: [push] + +jobs: + tests: + uses: ./.github/workflows/tests.yml + type-check: + uses: ./.github/workflows/type-check.yml + build: + needs: [tests, type-check] + uses: ./.github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d04c4e..8099aab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: 'Run tests' -on: [push, workflow_dispatch] +on: [workflow_call, workflow_dispatch] jobs: build: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c4b8e05..e240b58 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ name: 'Run tests' -on: [push, workflow_dispatch] +on: [workflow_call, workflow_dispatch] jobs: run-tests: diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml index 08c8310..6047e39 100644 --- a/.github/workflows/type-check.yml +++ b/.github/workflows/type-check.yml @@ -1,6 +1,6 @@ name: 'Run tests' -on: [push, workflow_dispatch] +on: [workflow_call, workflow_dispatch] jobs: type-check: From 1958d3afe730e64d146c4dc75e00ff5eca504bec Mon Sep 17 00:00:00 2001 From: Gauthier Fiorentino Date: Thu, 14 Mar 2024 17:57:42 +0100 Subject: [PATCH 3/3] CI: Fix workflow names --- .github/workflows/build.yml | 2 +- .github/workflows/type-check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8099aab..f978381 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: 'Run tests' +name: 'Build' on: [workflow_call, workflow_dispatch] diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml index 6047e39..763feb2 100644 --- a/.github/workflows/type-check.yml +++ b/.github/workflows/type-check.yml @@ -1,4 +1,4 @@ -name: 'Run tests' +name: 'Type check' on: [workflow_call, workflow_dispatch]