From b772af5d39abcf4175440ffc87d1ad89d12d2ba6 Mon Sep 17 00:00:00 2001 From: Starystars67 Date: Fri, 9 Oct 2026 13:26:02 +0100 Subject: [PATCH] Run lint, tests and the build in CI, and before a release image is built --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ .github/workflows/release.yml | 19 +++++++++++++++++++ .github/workflows/staging.yml | 19 +++++++++++++++++++ 3 files changed, 61 insertions(+) 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..050b9e8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - name: Lint + run: npm run lint:check + - name: Tests + run: npm test + - name: Build + run: npm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2dc8da..c43d364 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,26 @@ on: types: [published] jobs: + # Nothing is built and pushed unless the same checks the CI workflow runs pass first. + checks: + if: "!github.event.release.prerelease" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - name: Lint + run: npm run lint:check + - name: Tests + run: npm test + - name: Build + run: npm run build + docker: + needs: checks if: "!github.event.release.prerelease" runs-on: ubuntu-latest steps: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index cf4d861..27c4921 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -5,7 +5,26 @@ on: types: [published] jobs: + # Nothing is built and pushed unless the same checks the CI workflow runs pass first. + checks: + if: github.event.release.prerelease + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - name: Lint + run: npm run lint:check + - name: Tests + run: npm test + - name: Build + run: npm run build + docker: + needs: checks if: github.event.release.prerelease runs-on: ubuntu-latest steps: