|
9 | 9 | schedule:
|
10 | 10 | - cron: '0 2 * * 1' # At 02:00 on Monday
|
11 | 11 |
|
12 |
| -env: |
13 |
| - NODE_OPTIONS: --max-old-space-size=4096 |
| 12 | +permissions: {} |
14 | 13 |
|
15 | 14 | jobs:
|
16 | 15 | test:
|
17 | 16 | name: Test
|
18 |
| - timeout-minutes: 15 |
| 17 | + timeout-minutes: 5 |
19 | 18 | strategy:
|
20 | 19 | matrix:
|
21 | 20 | os: [ubuntu-latest]
|
22 |
| - node-version: [16, 18] |
| 21 | + node-version: |
| 22 | + - 16 |
| 23 | + - 18 |
| 24 | + - 20 |
| 25 | + - 21 |
23 | 26 | include:
|
24 | 27 | - os: macos-latest
|
25 |
| - node-version: 16 # LTS |
| 28 | + node-version: 20 # LTS |
| 29 | + - os: windows-latest |
| 30 | + node-version: 20 # LTS |
26 | 31 | fail-fast: false
|
27 | 32 | runs-on: ${{ matrix.os }}
|
28 | 33 | steps:
|
29 |
| - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 |
| 34 | + - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 |
| 35 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
30 | 36 | with:
|
31 |
| - fetch-depth: 0 |
| 37 | + disable-sudo: true |
| 38 | + egress-policy: block |
| 39 | + allowed-endpoints: > |
| 40 | + github.com:443 |
| 41 | + registry.npmjs.org:443 |
| 42 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
32 | 43 | - name: Use Node.js ${{ matrix.node-version }}
|
33 |
| - uses: actions/setup-node@v3 |
| 44 | + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
34 | 45 | with:
|
35 | 46 | node-version: ${{ matrix.node-version }}
|
| 47 | + cache: npm |
36 | 48 | - name: Bootstrap project
|
37 |
| - run: | |
38 |
| - npm ci --ignore-scripts |
39 |
| - - uses: Yuri6037/[email protected] |
| 49 | + run: npm ci --ignore-scripts --prefer-offline |
| 50 | + - uses: Yuri6037/Action-FakeTTY@1abc69c7d530815855caedcd73842bae5687c1a6 # v1.1 |
40 | 51 | - name: Run tests
|
41 | 52 | run: faketty npm test --ignore-scripts
|
42 | 53 |
|
43 | 54 | code-lint:
|
44 | 55 | name: Code Lint
|
45 | 56 | runs-on: ubuntu-latest
|
46 | 57 | steps:
|
47 |
| - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 |
48 |
| - - name: Use Node.js 16 |
49 |
| - uses: actions/setup-node@v3 |
| 58 | + - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 |
| 59 | + with: |
| 60 | + disable-sudo: true |
| 61 | + egress-policy: block |
| 62 | + allowed-endpoints: > |
| 63 | + api.github.com:443 |
| 64 | + github.com:443 |
| 65 | + nodejs.org:443 |
| 66 | + registry.npmjs.org:443 |
| 67 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 68 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 69 | + - name: Use Node.js 20 |
| 70 | + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
50 | 71 | with:
|
51 |
| - node-version: 16 |
| 72 | + node-version: 20 |
| 73 | + cache: 'npm' |
52 | 74 | - name: Bootstrap project
|
53 | 75 | run: |
|
54 |
| - npm ci --ignore-scripts |
| 76 | + npm ci \ |
| 77 | + --ignore-scripts \ |
| 78 | + --prefer-offline |
55 | 79 | - name: Verify code linting
|
56 |
| - run: npm run lint |
| 80 | + run: npm run lint --ignore-scripts |
57 | 81 |
|
58 | 82 | commit-lint:
|
59 | 83 | name: Commit Lint
|
60 | 84 | runs-on: ubuntu-latest
|
61 | 85 | if: ${{ github.event.pull_request }}
|
62 | 86 | steps:
|
63 |
| - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 |
| 87 | + - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 |
| 88 | + with: |
| 89 | + disable-sudo: true |
| 90 | + egress-policy: audit |
| 91 | + allowed-endpoints: > |
| 92 | + github.com:443 |
| 93 | + registry.npmjs.org:443 |
| 94 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
64 | 95 | with:
|
65 | 96 | fetch-depth: 0
|
66 |
| - - name: Use Node.js 16 |
67 |
| - uses: actions/setup-node@v3 |
| 97 | + - name: Use Node.js 20 |
| 98 | + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
68 | 99 | with:
|
69 |
| - node-version: 16 |
| 100 | + node-version: 20 |
| 101 | + cache: npm |
70 | 102 | - name: Bootstrap project
|
71 | 103 | run: |
|
72 |
| - npm ci --ignore-scripts |
| 104 | + npm ci \ |
| 105 | + --ignore-scripts \ |
| 106 | + --prefer-offline |
73 | 107 | - name: Verify commit linting
|
74 |
| - run: npx commitlint --from origin/master --to HEAD --verbose |
| 108 | + run: | |
| 109 | + npm exec \ |
| 110 | + --no-install \ |
| 111 | + --package=@commitlint/cli \ |
| 112 | + -- \ |
| 113 | + commitlint \ |
| 114 | + --from=origin/master \ |
| 115 | + --to=HEAD \ |
| 116 | + --verbose |
| 117 | +
|
0 commit comments