|
2 | 2 |
|
3 | 3 | # For more information see: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow
|
4 | 4 |
|
5 |
| -name: CI |
| 5 | +name: Quality Assurance |
6 | 6 |
|
7 | 7 | on:
|
8 | 8 | push:
|
@@ -30,7 +30,7 @@ permissions:
|
30 | 30 |
|
31 | 31 | jobs:
|
32 | 32 | get-matrix:
|
33 |
| - name: Configure Node LTS environment matrix |
| 33 | + name: Configure Node environment matrix |
34 | 34 | runs-on: ubuntu-latest
|
35 | 35 |
|
36 | 36 | outputs:
|
|
65 | 65 | with:
|
66 | 66 | persist-credentials: false
|
67 | 67 | show-progress: false
|
68 |
| - - name: Set up Node.js LTS |
| 68 | + - name: Set up Node.js |
69 | 69 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
70 | 70 | with:
|
71 | 71 | cache: "npm"
|
|
92 | 92 | - name: Validate YAML files
|
93 | 93 | run: yamllint -c .yamllint.yaml -f github ./
|
94 | 94 |
|
95 |
| - tests: |
96 |
| - name: Unit, e2e, coverage |
| 95 | + test: |
| 96 | + name: Codemod JSSG tests |
| 97 | + |
| 98 | + if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }} |
| 99 | + |
| 100 | + runs-on: ${{ matrix.os }} |
| 101 | + |
| 102 | + strategy: |
| 103 | + fail-fast: false |
| 104 | + matrix: |
| 105 | + os: |
| 106 | + - macos-latest |
| 107 | + - ubuntu-latest |
| 108 | + - windows-latest |
| 109 | + |
| 110 | + steps: |
| 111 | + - name: Harden the runner (Audit all outbound calls) |
| 112 | + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 |
| 113 | + with: |
| 114 | + egress-policy: audit |
| 115 | + |
| 116 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 117 | + with: |
| 118 | + persist-credentials: false |
| 119 | + show-progress: false |
| 120 | + - name: Set up Node.js |
| 121 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 122 | + with: |
| 123 | + cache: "npm" |
| 124 | + check-latest: true |
| 125 | + node-version-file: ".nvmrc" |
| 126 | + - run: npm ci |
| 127 | + - run: node --run test |
| 128 | + |
| 129 | + legacy-tests: |
| 130 | + name: Run legacy tests |
97 | 131 |
|
98 | 132 | if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
|
99 | 133 |
|
@@ -126,10 +160,8 @@ jobs:
|
126 | 160 | check-latest: true
|
127 | 161 | node-version: ${{ matrix.node-version }}
|
128 | 162 | - run: npm ci
|
129 |
| - - name: Run recipe tests |
130 |
| - run: >- |
131 |
| - node |
132 |
| - --run test |
133 |
| - --test-coverage-lines=0.8 |
134 |
| - --test-reporter-destination=./coverage.lcov |
135 |
| - --test-reporter=lcov |
| 163 | + # Codemod has changed its paradigm, but there is still a recipe that uses the old one, which is why we run it alongside it. |
| 164 | + # The old paradigm used node to run codemod, which is why we run it on several versions. |
| 165 | + # REF: https://codemod.com/blog/new-codemod-cli |
| 166 | + - name: Run legacy recipe tests |
| 167 | + run: node --run test-legacy |
0 commit comments