Skip to content

Commit 0b3384c

Browse files
authored
Migrate to Node 20, clean up workflows (#2902)
Tests still appear to fail per #2898. Unfortunately, I need actions/runner#2347 to ignore the test failures properly - I need them to be warnings, not hard errors.
1 parent 7c63205 commit 0b3384c

File tree

9 files changed

+101
-145
lines changed

9 files changed

+101
-145
lines changed

actions/setup/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# In the future, I'd like to fold this into its own action under the Mithril.js
2+
# org and include `actions/checkout` as well. It'd simplify maintenance a bit
3+
# and I could reuse it across multiple repos.
4+
name: Setup CI context
5+
description: Sets up repo and Node context and installs packages
6+
7+
inputs:
8+
# See supported Node.js release schedule here:
9+
# https://github.com/nodejs/Release
10+
node-version:
11+
default: 20
12+
description: The Node version to use
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ inputs.node-version }}
20+
- run: npm ci
21+
shell: bash

workflows/lint-docs.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

workflows/lint-js.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

workflows/merge.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,11 @@ concurrency: prr:deploy
1010

1111
jobs:
1212
merge:
13-
1413
runs-on: ubuntu-latest
1514

16-
strategy:
17-
matrix:
18-
node-version: [16.x]
19-
2015
steps:
21-
- uses: actions/checkout@v3
22-
with:
23-
ref: 'next'
24-
fetch-depth: 0
25-
26-
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v3
28-
with:
29-
node-version: ${{ matrix.node-version }}
30-
cache: 'npm'
31-
- run: npm ci
16+
- run: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
17+
- uses: ./.github/actions/setup
3218
- run: npm run build
3319
- run: npx pr-release merge --target master --source next --commit --force --clean --changelog ./docs/recent-changes.md --compact --minimize-semver-change
3420
env:

workflows/push-master.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
name: 'Push `master`'
1+
name: Warn on pushing to `master`
22
on:
33
pull_request:
44
types: [opened]
5-
branches: ['master']
5+
branches: [master]
6+
permissions:
7+
issues: write
68
jobs:
79
comment:
810
runs-on: ubuntu-latest
911
steps:
10-
- uses: actions/github-script@v3
11-
with:
12-
github-token: ${{secrets.GITHUB_TOKEN}}
13-
script: |
14-
await github.issues.createComment({
15-
issue_number: context.issue.number,
16-
owner: context.repo.owner,
17-
repo: context.repo.repo,
18-
body: `⚠⚠⚠ Hey @${context.actor}, did you mean to open this against \`next\`? ⚠⚠⚠`
19-
})
12+
- run: |
13+
gh issue comment ${{ github.event.pull_request.url }} \
14+
--body '⚠⚠⚠ Hey @${{ github.actor }}, did you mean to open this against `next`? ⚠⚠⚠'
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
name: Post alert comment

workflows/rollback.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,11 @@ concurrency: prr:deploy
77

88
jobs:
99
pr:
10-
1110
runs-on: ubuntu-latest
1211

13-
strategy:
14-
matrix:
15-
node-version: [16.x]
16-
1712
steps:
18-
- uses: actions/checkout@v3
19-
with:
20-
ref: 'next'
21-
fetch-depth: 0
22-
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
24-
with:
25-
node-version: ${{ matrix.node-version }}
26-
cache: 'npm'
27-
- run: npm ci
13+
- run: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
14+
- uses: ./.github/actions/setup
2815
- run: npm run build
2916
- run: npx pr-release rollback --verbose --target master --source next --verbose --ignore 'package*' --ignore docs/changelog.md --ignore docs/recent-changes.md
3017
env:

workflows/test-js.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

workflows/pr.yml renamed to workflows/test-next-push.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
name: pr
1+
name: test-next-push
22

33
on:
44
push:
55
branches: [ next ]
6-
76
workflow_dispatch:
87

98
concurrency: prr:pre-release
109

1110
jobs:
12-
pr:
11+
build:
12+
uses: ./.github/workflows/test.yml
1313

14+
publish-prerelease:
15+
needs: build
1416
runs-on: ubuntu-latest
15-
16-
strategy:
17-
matrix:
18-
node-version: [16.x]
19-
2017
steps:
21-
- uses: actions/checkout@v3
22-
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
24-
with:
25-
node-version: ${{ matrix.node-version }}
26-
cache: 'npm'
27-
- run: npm ci
18+
- run: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
19+
- uses: ./.github/actions/setup
2820
- run: npm run build
2921
- run: npx pr-release pr --verbose --target master --source next --compact --verbose --minimize-semver-change
3022
env:

workflows/test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
branches: [ next ]
6+
workflow_dispatch:
7+
workflow_call:
8+
9+
permissions:
10+
actions: write
11+
contents: read
12+
13+
# This uses actions/checkout instead of `git clone` directly since it's way
14+
# easier than parsing everything out.
15+
16+
jobs:
17+
lint-docs:
18+
# https://github.com/MithrilJS/mithril.js/issues/2898
19+
# Semantics aren't quite what I'd prefer. This is what I'd really want:
20+
# https://github.com/actions/runner/issues/2347#issue-comment-box
21+
continue-on-error: true
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: ./.github/actions/setup
26+
- run: npm run lint:docs
27+
28+
lint-js:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: ./.github/actions/setup
33+
- run: npm run lint:js
34+
35+
build-js:
36+
needs: lint-js
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: ./.github/actions/setup
41+
- run: npm run build
42+
43+
test-js:
44+
needs: build-js
45+
runs-on: ubuntu-latest
46+
strategy:
47+
matrix:
48+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
49+
node-version:
50+
- 16
51+
- 18
52+
- 20
53+
- 22
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: ./.github/actions/setup
57+
with:
58+
node-version: ${{ matrix.node-version }}
59+
- run: npm run test:js

0 commit comments

Comments
 (0)