From f5e26d80db742028554829c5688e924608c8019e Mon Sep 17 00:00:00 2001 From: William Killerud Date: Mon, 8 Jul 2024 09:19:19 +0200 Subject: [PATCH] chore: fix the workflow OS matrix --- .github/workflows/publish.yml | 69 ++++++++++++++--------------------- .github/workflows/test.yml | 28 +++++++------- 2 files changed, 41 insertions(+), 56 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ce5f974a..c76d82c0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,47 +1,34 @@ name: Release and Publish on: - pull_request: - push: - branches: [ master ] + push: + branches: + - master jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: npm install - run: | - npm install - - name: npm lint - run: | - npm run lint - - name: npm test - run: | - npm test + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 - release: - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - runs-on: ubuntu-latest - needs: [test] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: npm install - run: | - npm install - - name: npx semantic-release - run: | - npx semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm install + + - name: Lint files + run: npm run lint + + - name: Run tests + run: npm run test + + - name: Run semantic release + run: npx semantic-release + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 503148bb..6cc1c6a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,30 +1,28 @@ name: Run Lint and Tests -on: push +on: + push: + branches-ignore: + - master jobs: build: - runs-on: ubuntu-latest strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] node-version: [18.x, 20.x] + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - name: npm install - run: | - npm install - env: - CI: true - - name: npm lint - run: | - npm run lint - env: - CI: true - - name: npm test - run: | - npm test + + - run: npm install + + - run: npm run lint + + - run: npm test