|
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 | + api.github.com:443 |
| 41 | + github.com:443 |
| 42 | + nodejs.org:443 |
| 43 | + registry.npmjs.org:443 |
| 44 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 45 | + with: |
| 46 | + persist-credentials: false |
32 | 47 | - name: Use Node.js ${{ matrix.node-version }}
|
33 |
| - uses: actions/setup-node@v3 |
| 48 | + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
34 | 49 | with:
|
35 | 50 | node-version: ${{ matrix.node-version }}
|
| 51 | + cache: npm |
36 | 52 | - name: Bootstrap project
|
37 |
| - run: | |
38 |
| - npm ci --ignore-scripts |
39 |
| - - uses: Yuri6037/[email protected] |
| 53 | + run: npm ci --ignore-scripts --prefer-offline |
| 54 | + - uses: Yuri6037/Action-FakeTTY@1abc69c7d530815855caedcd73842bae5687c1a6 # v1.1 |
40 | 55 | - name: Run tests
|
41 | 56 | run: faketty npm test --ignore-scripts
|
42 | 57 |
|
43 | 58 | code-lint:
|
44 | 59 | name: Code Lint
|
45 | 60 | runs-on: ubuntu-latest
|
46 | 61 | steps:
|
47 |
| - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 |
48 |
| - - name: Use Node.js 16 |
49 |
| - uses: actions/setup-node@v3 |
| 62 | + - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 |
| 63 | + with: |
| 64 | + disable-sudo: true |
| 65 | + egress-policy: block |
| 66 | + allowed-endpoints: > |
| 67 | + api.github.com:443 |
| 68 | + github.com:443 |
| 69 | + nodejs.org:443 |
| 70 | + registry.npmjs.org:443 |
| 71 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 72 | + with: |
| 73 | + persist-credentials: false |
| 74 | + - name: Use Node.js 20 |
| 75 | + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
50 | 76 | with:
|
51 |
| - node-version: 16 |
| 77 | + node-version: 20 |
| 78 | + cache: 'npm' |
52 | 79 | - name: Bootstrap project
|
53 | 80 | run: |
|
54 |
| - npm ci --ignore-scripts |
| 81 | + npm ci \ |
| 82 | + --ignore-scripts \ |
| 83 | + --prefer-offline |
55 | 84 | - name: Verify code linting
|
56 |
| - run: npm run lint |
| 85 | + run: npm run lint --ignore-scripts |
57 | 86 |
|
58 | 87 | commit-lint:
|
59 | 88 | name: Commit Lint
|
60 | 89 | runs-on: ubuntu-latest
|
61 | 90 | if: ${{ github.event.pull_request }}
|
62 | 91 | steps:
|
63 |
| - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 |
| 92 | + - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 |
| 93 | + with: |
| 94 | + disable-sudo: true |
| 95 | + egress-policy: block |
| 96 | + allowed-endpoints: > |
| 97 | + github.com:443 |
| 98 | + registry.npmjs.org:443 |
| 99 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
64 | 100 | with:
|
65 | 101 | fetch-depth: 0
|
66 |
| - - name: Use Node.js 16 |
67 |
| - uses: actions/setup-node@v3 |
| 102 | + persist-credentials: false |
| 103 | + - name: Use Node.js 20 |
| 104 | + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
| 105 | + with: |
| 106 | + node-version: 20 |
| 107 | + cache: npm |
| 108 | + - name: Bootstrap project |
| 109 | + run: | |
| 110 | + npm ci \ |
| 111 | + --ignore-scripts \ |
| 112 | + --prefer-offline |
| 113 | + - name: Verify commit linting |
| 114 | + run: | |
| 115 | + npm exec \ |
| 116 | + --no-install \ |
| 117 | + --package=@commitlint/cli \ |
| 118 | + -- \ |
| 119 | + commitlint \ |
| 120 | + --from=origin/master \ |
| 121 | + --to=HEAD \ |
| 122 | + --verbose |
| 123 | +
|
| 124 | + lockfile-lint: |
| 125 | + name: Lockfile Lint |
| 126 | + runs-on: ubuntu-latest |
| 127 | + steps: |
| 128 | + - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 |
68 | 129 | with:
|
69 |
| - node-version: 16 |
| 130 | + disable-sudo: true |
| 131 | + egress-policy: block |
| 132 | + allowed-endpoints: > |
| 133 | + github.com:443 |
| 134 | + registry.npmjs.org:443 |
| 135 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 136 | + with: |
| 137 | + persist-credentials: false |
| 138 | + - name: Use Node.js 20 |
| 139 | + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
| 140 | + with: |
| 141 | + node-version: 20 |
| 142 | + cache: npm |
70 | 143 | - name: Bootstrap project
|
71 | 144 | run: |
|
72 |
| - npm ci --ignore-scripts |
| 145 | + npm ci \ |
| 146 | + --ignore-scripts \ |
| 147 | + --prefer-offline |
73 | 148 | - name: Verify commit linting
|
74 |
| - run: npx commitlint --from origin/master --to HEAD --verbose |
| 149 | + run: | |
| 150 | + npm exec \ |
| 151 | + --no-install \ |
| 152 | + --package=lockfile-lint \ |
| 153 | + -- \ |
| 154 | + lockfile-lint \ |
| 155 | + --path=package-lock.json \ |
| 156 | + --allowed-hosts=npm \ |
| 157 | + --validate-https \ |
| 158 | + --validate-integrity \ |
| 159 | + --validate-package-names |
| 160 | +
|
0 commit comments