Skip to content

Commit b97a99f

Browse files
authored
Merge pull request #125 from endojs/mfig-eslint-9
feat(eslint-plugin): update for ESLint 9 (flat config) compatibility
2 parents b5b6714 + 45e4f41 commit b97a99f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2859
-1578
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Set up Node.js
2+
description: 'Set up Node.js environment'
3+
4+
inputs:
5+
node-version:
6+
description: 'The version or identifier (node-old, node-new, and xs supported) of Node.js to use'
7+
required: true
8+
9+
outputs:
10+
node-version:
11+
description: 'The version of Node.js that was set up'
12+
value: ${{ steps.set-node-version.outputs.NODE_VERSION }}
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- id: set-node-version
18+
name: Set correct node version
19+
shell: bash
20+
env:
21+
VERSION_IDENTIFIER: ${{ inputs.node-version }}
22+
run: |
23+
set -o xtrace
24+
25+
# By default, treat the version identifier as a semantic version.
26+
OUTPUT_NODE_VERSION="$VERSION_IDENTIFIER"
27+
case $VERSION_IDENTIFIER in
28+
node-old | xs)
29+
OUTPUT_NODE_VERSION="20"
30+
;;
31+
node-new)
32+
OUTPUT_NODE_VERSION="22"
33+
;;
34+
esac
35+
36+
echo "NODE_VERSION=$OUTPUT_NODE_VERSION" >> "$GITHUB_OUTPUT"
37+
38+
- uses: actions/setup-node@v3
39+
with:
40+
node-version: ${{ steps.set-node-version.outputs.NODE_VERSION }}

.github/workflows/build-and-test.yml

Lines changed: 72 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,97 +4,102 @@ name: Test all Packages
44
# branches)
55

66
on:
7-
push:
8-
branches: [main]
9-
pull_request:
7+
push:
8+
branches: [main]
9+
pull_request:
1010

1111
# set ESM_DISABLE_CACHE=true (will be JSON parsed)
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
node-version: ['18.x']
17+
node-version: ['node-old', 'node-new']
1818
steps:
19-
- uses: actions/checkout@v3
20-
with:
21-
submodules: 'true'
22-
- uses: actions/setup-node@v3
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
- name: cache node modules
26-
uses: actions/cache@v3
27-
with:
28-
path: ~/.cache/yarn
29-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
30-
restore-keys: |
31-
${{ runner.os }}-yarn-
19+
- uses: actions/checkout@v3
20+
with:
21+
submodules: 'true'
22+
- uses: ./.github/actions/setup-node
23+
id: setup-node
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- name: cache node modules
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/yarn
30+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-yarn-
3233
33-
- run: yarn install
34-
- run: yarn build
34+
- run: yarn install
35+
- run: yarn build
3536

36-
- name: cache build outputs
37-
uses: actions/cache@v3
38-
with:
39-
path: .
40-
key: ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
37+
- name: cache build outputs
38+
uses: actions/cache@v3
39+
with:
40+
path: .
41+
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-built-${{ github.sha }}
4142

4243
lint:
4344
needs: build
4445
runs-on: ubuntu-latest
4546
strategy:
4647
matrix:
47-
node-version: ['18.x']
48+
node-version: ['node-old']
4849
steps:
49-
- uses: actions/setup-node@v3
50-
with:
51-
node-version: ${{ matrix.node-version }}
52-
# BEGIN-RESTORE-BOILERPLATE
53-
- name: restore built files
54-
id: built
55-
uses: actions/cache@v3
56-
with:
57-
path: .
58-
key: ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
59-
- uses: actions/checkout@v3
60-
with:
61-
submodules: 'true'
62-
if: steps.built.outputs.cache-hit != 'true'
63-
- run: yarn install
64-
if: steps.built.outputs.cache-hit != 'true'
65-
- run: yarn build
66-
if: steps.built.outputs.cache-hit != 'true'
67-
# END-RESTORE-BOILERPLATE
50+
- uses: actions/checkout@v3
51+
- uses: ./.github/actions/setup-node
52+
id: setup-node
53+
with:
54+
node-version: ${{ matrix.node-version }}
55+
# BEGIN-RESTORE-BOILERPLATE
56+
- name: restore built files
57+
id: built
58+
uses: actions/cache@v3
59+
with:
60+
path: .
61+
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-built-${{ github.sha }}
62+
- uses: actions/checkout@v3
63+
with:
64+
submodules: 'true'
65+
if: steps.built.outputs.cache-hit != 'true'
66+
- run: yarn install
67+
if: steps.built.outputs.cache-hit != 'true'
68+
- run: yarn build
69+
if: steps.built.outputs.cache-hit != 'true'
70+
# END-RESTORE-BOILERPLATE
6871

69-
- run: yarn lint
72+
- run: yarn lint
7073

7174
test:
7275
# BEGIN-TEST-BOILERPLATE
7376
needs: build
7477
runs-on: ubuntu-latest
7578
strategy:
7679
matrix:
77-
node-version: ['18.x']
80+
node-version: ['node-old', 'node-new']
7881
steps:
79-
- uses: actions/setup-node@v3
80-
with:
81-
node-version: ${{ matrix.node-version }}
82-
# END-TEST-BOILERPLATE
83-
# BEGIN-RESTORE-BOILERPLATE
84-
- name: restore built files
85-
id: built
86-
uses: actions/cache@v3
87-
with:
88-
path: .
89-
key: ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
90-
- uses: actions/checkout@v3
91-
with:
92-
submodules: 'true'
93-
if: steps.built.outputs.cache-hit != 'true'
94-
- run: yarn install
95-
if: steps.built.outputs.cache-hit != 'true'
96-
- run: yarn build
97-
if: steps.built.outputs.cache-hit != 'true'
98-
# END-RESTORE-BOILERPLATE
82+
- uses: actions/checkout@v3
83+
- uses: ./.github/actions/setup-node
84+
id: setup-node
85+
with:
86+
node-version: ${{ matrix.node-version }}
87+
# END-TEST-BOILERPLATE
88+
# BEGIN-RESTORE-BOILERPLATE
89+
- name: restore built files
90+
id: built
91+
uses: actions/cache@v3
92+
with:
93+
path: .
94+
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-built-${{ github.sha }}
95+
- uses: actions/checkout@v3
96+
with:
97+
submodules: 'true'
98+
if: steps.built.outputs.cache-hit != 'true'
99+
- run: yarn install
100+
if: steps.built.outputs.cache-hit != 'true'
101+
- run: yarn build
102+
if: steps.built.outputs.cache-hit != 'true'
103+
# END-RESTORE-BOILERPLATE
99104

100-
- run: yarn test
105+
- run: yarn test

0 commit comments

Comments
 (0)