From 66ca7d32e5c890f12b09d759d7e459eb0fbba47e Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 8 Aug 2024 16:00:29 +0200 Subject: [PATCH] =?UTF-8?q?CI:=20lint=20&=20test=20on=20PRs=20too,=20with?= =?UTF-8?q?=20Node=2018-22=20=F0=9F=92=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 13 +---------- .github/workflows/lint-test.yml | 35 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/lint-test.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 12107ee..b65d769 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,18 +6,7 @@ on: jobs: lint-test: name: lint, build & test - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - - run: npm ci - - run: npm run lint - - run: npm run build - - run: npm test + uses: './.github/workflows/lint-test.yml' build-and-publish: name: build & publish Docker image diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml new file mode 100644 index 0000000..d5c0557 --- /dev/null +++ b/.github/workflows/lint-test.yml @@ -0,0 +1,35 @@ +name: lint, build & test +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + workflow_call: + +jobs: + lint-test: + name: lint, build & test + runs-on: ubuntu-latest + strategy: + matrix: + node-version: + - '16.x' + - '18.x' + - '20.x' + - '22.x' + + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - run: npm ci + + - run: npm run lint + - run: npm run build + - run: npm test