Skip to content

Commit

Permalink
chore: update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dgellow committed Sep 29, 2023
1 parent d68b411 commit 7cd1a0a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 75 deletions.
65 changes: 22 additions & 43 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,37 @@ on:
branches:
- main
pull_request:

name: ci
jobs:
test:
runs-on: ubuntu-latest
tests:
strategy:
matrix:
node: [18, 20]
os: ['ubuntu-latest', 'windows-latest']

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: node --version
# The first installation step ensures that all of our production
# dependencies work on the given Node.js version, this helps us find
# dependencies that don't match our engines field:
- run: npm install --production --engine-strict --ignore-scripts --no-package-lock
# Clean up the production install, before installing dev/production:
- run: rm -rf node_modules
- run: npm install
- run: npm run test:node${{ matrix.node }}
env:
MOCHA_THROW_DEPRECATION: false
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm test
env:
MOCHA_THROW_DEPRECATION: false
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
cache: pnpm

- run: corepack enable && corepack install
# Note: actions/setup-node doesn't yet provide parameters for corepack, we need to run it again after enabling it
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm run lint
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm run docs
- uses: JustinBeckwith/linkinator-action@v1
with:
paths: docs/
node-version: ${{ matrix.node }}
cache: pnpm

- run: node --version

- name: Install dependencies
run: pnpm install

- name: Lint code
run: pnpm lint

- name: Run tests
run: pnpm test
33 changes: 16 additions & 17 deletions .github/workflows/create-release-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
cache: pnpm
- run: corepack enable && corepack install
# Note: actions/setup-node doesn't yet provide parameters for corepack, we need to run it again after enabling it
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Install dependencies
run: npm install

- name: Lint code
run: npm run lint

- name: Run tests
run: npm run test

- name: Compile
run: npm run compile
run: pnpm install

- name: Create release PRs
run: |
npm run cli -- release-pr \
--token=${{ secrets.GITHUB_TOKEN }} \
--repo-url=${{ github.repository }} \
--target-branch=main
pnpm start \
-- release-pr \
--token=${{ secrets.GITHUB_TOKEN }} \
--repo-url=${{ github.repository }} \
--target-branch=main
32 changes: 17 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -29,21 +29,22 @@ jobs:
git merge --no-ff main
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
cache: pnpm
- run: corepack enable && corepack install
# Note: actions/setup-node doesn't yet provide parameters for corepack, we need to run it again after enabling it
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Install dependencies
run: npm install

- name: Lint code
run: npm run lint

- name: Run tests
run: npm run test
run: pnpm install

- name: Compile
run: npm run compile
run: pnpm build

- name: Commit and push build directory
run: |
Expand All @@ -53,7 +54,8 @@ jobs:
- name: Create github release
run: |
npm run cli -- github-release \
--token=${{ secrets.GITHUB_TOKEN }} \
--repo-url=${{ github.repository }} \
--target-branch=release
pnpm start \
-- github-release \
--token=${{ secrets.GITHUB_TOKEN }} \
--repo-url=${{ github.repository }} \
--target-branch=release

0 comments on commit 7cd1a0a

Please sign in to comment.