Skip to content

Port CI changes from Express5 repo #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/blue-jeans-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
22 changes: 22 additions & 0 deletions .github/actions/node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Get ready for Node'
description: 'Sets up Node using Mise and installs'
inputs:
node-version-override:
description: 'Override Node version'
required: false
runs:
using: "composite"
steps:
- if: ${{ inputs.node-version-override }}
uses: jdx/mise-action@v2
with:
mise_toml: |
[tools]
node = "${{ inputs.node-version-override }}"
- if: ${{ ! inputs.node-version-override }}
uses: jdx/mise-action@v2
- uses: actions/setup-node@v4
with:
cache: 'npm'
- run: npm ci
shell: bash
50 changes: 22 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ jobs:
name: Build and test with Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: ./.github/actions/node
with:
mise_toml: |
[tools]
node = "${{ matrix.node }}"
- uses: actions/setup-node@v4
with:
cache: 'npm'
- run: npm ci
node-version-override: ${{ matrix.node }}
- run: npm test

# This runs against an old alpha of GraphQL v17; hopefully Apollo Server v5
Expand All @@ -30,11 +24,7 @@ jobs:
name: Test against GraphQL 17 alpha with incremental delivery
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: actions/setup-node@v4
with:
cache: 'npm'
- run: npm ci
- uses: ./.github/actions/node
- run: npm i --legacy-peer-deps graphql@17.0.0-alpha.2
- run: npm test
env:
Expand All @@ -45,33 +35,37 @@ jobs:
name: Prettier
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: actions/setup-node@v4
with:
cache: 'npm'
- run: npm ci
- uses: ./.github/actions/node
- run: npm run prettier-check

lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: actions/setup-node@v4
with:
cache: 'npm'
- run: npm ci
- uses: ./.github/actions/node
- run: npm run lint

spell-check:
runs-on: ubuntu-latest
name: Spell Check
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: actions/setup-node@v4
with:
cache: 'npm'
- run: npm ci
- uses: ./.github/actions/node
- run: npm run spell-check

# Ensure that any PR that changes packages has a changeset on it (perhaps an
# empty one created with `changeset --empty`). We run the Changesets job
# itself on all branches so that we can require it to pass, gbut we don't run
# the actual check on the "Version Packages" PRs themselves.
changeset:
runs-on: ubuntu-latest
name: Changesets
steps:
- uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: ./.github/actions/node
- run: npm run changeset-check
if: ${{ ! startsWith(github.head_ref, 'changeset-release/') }}
15 changes: 3 additions & 12 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,12 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Install Node with Mise
uses: jdx/mise-action@v2

- name: Setup Node.js 16.x
uses: actions/setup-node@v4
with:
cache: 'npm'

- name: Install Dependencies
run: npm ci

- uses: ./.github/actions/node
- name: Create Release Pull Request / NPM Publish
uses: changesets/action@v1
with:
publish: npm run publish-changeset
publish: npm run changeset-publish
version: npm run changeset-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"prepack": "npm run build",
"prettier-check": "prettier --check .",
"prettier-fix": "prettier --write .",
"publish-changeset": "changeset publish",
"changeset-publish": "npm run compile && changeset publish",
"changeset-check": "changeset status --verbose --since=origin/main",
"changeset-version": "changeset version && npm i",
"spell-check": "cspell lint '**' --no-progress || (echo 'Add any real words to cspell-dict.txt.'; exit 1)",
"test": "jest",
"test:ci": "jest --coverage --ci --maxWorkers=2 --reporters=default --reporters=jest-junit",
Expand Down