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