From 9cde2ae68a6c4d9d33904728284572b7c9fdbda8 Mon Sep 17 00:00:00 2001 From: Henning Muszynski <6048870+henningmu@users.noreply.github.com> Date: Thu, 25 May 2023 10:00:58 +0200 Subject: [PATCH] ci: Clean up CI workflow (#26) Co-authored-by: Henning Muszynski --- .../workflows/check-pull-request-health.yml | 41 +++++++++++++++++++ .github/workflows/nodejs.yml | 25 ----------- .github/workflows/publish.yml | 15 +++---- 3 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/check-pull-request-health.yml delete mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/check-pull-request-health.yml b/.github/workflows/check-pull-request-health.yml new file mode 100644 index 0000000..11c4805 --- /dev/null +++ b/.github/workflows/check-pull-request-health.yml @@ -0,0 +1,41 @@ +name: Check Pull Request Health + +on: + pull_request: + types: + - opened + - synchronize + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, 18.x] + + timeout-minutes: 60 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Lint the codebase + run: npm run lint + env: + CI: true + + - name: Test the codebase + run: npm run test + env: + CI: true + + - name: Build the codebase + run: npm run build diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index 5446827..0000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.x] - - timeout-minutes: 60 - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci --legacy-peer-deps - - run: npm run build - - run: npm test - env: - CI: true - - run: npm run lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d07981f..842026f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,31 +10,32 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v3 - name: Read Node.js version from '.nvmrc' id: nvmrc run: | echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT - - name: Setup Node - uses: actions/setup-node@v1 + - name: Setup Node.js ${{ steps.nvmrc.outputs.NODE_VERSION }} + uses: actions/setup-node@v3 with: node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} - name: Install dependencies run: npm ci --legacy-peer-deps - - name: Lint + - name: Lint the codebase run: npm run lint env: CI: true - - name: Build + - name: Build the codebase run: npm run build - name: Publish to GitHub Package Registry - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} registry-url: https://npm.pkg.github.com/ @@ -44,7 +45,7 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Publish to npm registry - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} registry-url: https://registry.npmjs.org/