From 73cc97ca788a7c9a354935702de2e94034f6174b Mon Sep 17 00:00:00 2001 From: Igor Starovierov Date: Mon, 7 Oct 2024 15:27:10 +0300 Subject: [PATCH] ci: Extend node version matrix and check docs (#25) --- .github/workflows/ci.yml | 29 +++++++++++++++++------------ .github/workflows/docs.yml | 18 ++++++++++++++++++ .github/workflows/release.yml | 16 ++++++---------- 3 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c1435c..a4a2f17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,23 +5,28 @@ on: pull_request: jobs: - ci: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm run lint + + tests: runs-on: ubuntu-latest strategy: matrix: - node-version: [20.x] + node-version: [12, 14, 16, 18, 20, 22] steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "npm" - - name: Install dependencies - run: npm ci - - name: Linters - run: npm run lint - - name: Tests - run: npm test + - run: npm ci + - run: npm test diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..879cc21 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,18 @@ +name: docs +on: + workflow_call: + pull_request: + push: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm run docs + - name: Check README.md is up to date (forget to run 'npm run docs'?) + uses: NathanielHill/fail-if-changes@9e6ed6bb0543551728592d8114cfaa1dcd9155a6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6d41b7..72f1842 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: release on: push: @@ -10,19 +10,15 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: "20.x" + node-version: 20 cache: "npm" - - name: Install dependencies - run: npm ci - - name: Release + - run: npm ci + - run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release