|
| 1 | +name: PR Checks |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + tags: '*' |
| 8 | +concurrency: |
| 9 | + # Skip intermediate builds: all builds except for builds on the `master` branch |
| 10 | + # Cancel intermediate builds: only pull request builds |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} |
| 12 | + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | +jobs: |
| 16 | + finalize-pr-checks: |
| 17 | + if: always() # this line is important to keep the `finalize` job from being marked as skipped; do not change or delete this line |
| 18 | + runs-on: ubuntu-latest |
| 19 | + timeout-minutes: 10 |
| 20 | + needs: [checked-in-files, build, test, make-targets, stalecheck-npm-install] |
| 21 | + steps: |
| 22 | + - run: | |
| 23 | + echo checked-in-files: ${{ needs.checked-in-files.result }} |
| 24 | + echo build: ${{ needs.build.result }} |
| 25 | + echo test: ${{ needs.test.result }} |
| 26 | + echo make-targets: ${{ needs.make-targets.result }} |
| 27 | + echo stalecheck-npm-install: ${{ needs.stalecheck-npm-install.result }} |
| 28 | + # The last line must NOT end with || |
| 29 | + # All other lines MUST end with || |
| 30 | + - run: exit 1 |
| 31 | + if: | |
| 32 | + (needs.checked-in-files.result != 'success') || |
| 33 | + (needs.build.result != 'success') || |
| 34 | + (needs.test.result != 'success') || |
| 35 | + (needs.make-targets.result != 'success') || |
| 36 | + (needs.stalecheck-npm-install.result != 'success') |
| 37 | + checked-in-files: |
| 38 | + timeout-minutes: 30 |
| 39 | + runs-on: ubuntu-latest |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + steps: |
| 43 | + ### Check out the repo: |
| 44 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 45 | + with: |
| 46 | + persist-credentials: false |
| 47 | + ### Cleanall: |
| 48 | + - run: make cleanall |
| 49 | + ### Install NodeJS |
| 50 | + # Unix (non-Windows): |
| 51 | + - uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 |
| 52 | + if: runner.os != 'Windows' |
| 53 | + - run: make unix-asdf-install |
| 54 | + if: runner.os != 'Windows' |
| 55 | + # Windows: |
| 56 | + # Windows does not support asdf, so we have to use `actions/setup-node` |
| 57 | + # to install asdf: |
| 58 | + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b |
| 59 | + if: runner.os == 'Windows' |
| 60 | + with: |
| 61 | + node-version-file: '.tool-versions' |
| 62 | + ### Install the NodeJS packages that we depend on: |
| 63 | + - run: make install-packages |
| 64 | + ### Print some debugging info: |
| 65 | + - name: Print the NodeJS version (for debugging) |
| 66 | + run: | |
| 67 | + which -a node |
| 68 | + node --version |
| 69 | + which -a npm |
| 70 | + npm --version |
| 71 | + ### Build: |
| 72 | + - run: make pack |
| 73 | + ### Clean (not cleanall!): |
| 74 | + - run: make clean |
| 75 | + ### Make sure there are no uncommited changes |
| 76 | + - uses: julia-actions/setup-julia@780022b48dfc0c2c6b94cfee6a9284850107d037 |
| 77 | + with: |
| 78 | + version: '1' |
| 79 | + - run: git --no-pager status |
| 80 | + - run: git --no-pager diff |
| 81 | + - run: julia ./ci/check_uncommitted_changes.jl |
| 82 | + build: |
| 83 | + timeout-minutes: 30 |
| 84 | + runs-on: ${{ matrix.os }} |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + os: |
| 89 | + - ubuntu-latest |
| 90 | + steps: |
| 91 | + ### Check out the repo: |
| 92 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 93 | + with: |
| 94 | + persist-credentials: false |
| 95 | + ### Cleanall: |
| 96 | + - run: make cleanall |
| 97 | + ### Install NodeJS |
| 98 | + # Unix (non-Windows): |
| 99 | + - uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 |
| 100 | + if: runner.os != 'Windows' |
| 101 | + - run: make unix-asdf-install |
| 102 | + if: runner.os != 'Windows' |
| 103 | + # Windows: |
| 104 | + # Windows does not support asdf, so we have to use `actions/setup-node` |
| 105 | + # to install asdf: |
| 106 | + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b |
| 107 | + if: runner.os == 'Windows' |
| 108 | + with: |
| 109 | + node-version-file: '.tool-versions' |
| 110 | + ### Install the NodeJS packages that we depend on: |
| 111 | + - run: make install-packages |
| 112 | + ### Print some debugging info: |
| 113 | + - name: Print the NodeJS version (for debugging) |
| 114 | + run: | |
| 115 | + which -a node |
| 116 | + node --version |
| 117 | + which -a npm |
| 118 | + npm --version |
| 119 | + ### Build: |
| 120 | + - run: make build |
| 121 | + - run: make pack |
| 122 | + ### Make sure some other `make` targets don't bitrot: |
| 123 | + - name: Run some other `make` targets to ensure that they don't bitrot |
| 124 | + run: | |
| 125 | + make clean |
| 126 | + make cleanall |
| 127 | + - name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot |
| 128 | + run: | |
| 129 | + make clean |
| 130 | + make cleanall |
| 131 | + test: |
| 132 | + timeout-minutes: 30 |
| 133 | + runs-on: ${{ matrix.os }} |
| 134 | + strategy: |
| 135 | + fail-fast: false |
| 136 | + matrix: |
| 137 | + os: |
| 138 | + - ubuntu-latest |
| 139 | + steps: |
| 140 | + ### Check out the repo: |
| 141 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 142 | + with: |
| 143 | + persist-credentials: false |
| 144 | + ### Cleanall: |
| 145 | + - run: make cleanall |
| 146 | + ### Install NodeJS |
| 147 | + # Unix (non-Windows): |
| 148 | + - uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 |
| 149 | + if: runner.os != 'Windows' |
| 150 | + - run: make unix-asdf-install |
| 151 | + if: runner.os != 'Windows' |
| 152 | + # Windows: |
| 153 | + # Windows does not support asdf, so we have to use `actions/setup-node` |
| 154 | + # to install asdf: |
| 155 | + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b |
| 156 | + if: runner.os == 'Windows' |
| 157 | + with: |
| 158 | + node-version-file: '.tool-versions' |
| 159 | + ### Install the NodeJS packages that we depend on: |
| 160 | + - run: make install-packages |
| 161 | + ### Print some debugging info: |
| 162 | + - name: Print the NodeJS version (for debugging) |
| 163 | + run: | |
| 164 | + which -a node |
| 165 | + node --version |
| 166 | + which -a npm |
| 167 | + npm --version |
| 168 | + ### Build: |
| 169 | + - run: make build |
| 170 | + - run: make test |
| 171 | + make-targets: # This is a job to make sure that none of the `make` targets bitrot |
| 172 | + timeout-minutes: 30 |
| 173 | + runs-on: ${{ matrix.os }} |
| 174 | + strategy: |
| 175 | + fail-fast: false |
| 176 | + matrix: |
| 177 | + os: |
| 178 | + - ubuntu-latest |
| 179 | + steps: |
| 180 | + ### Check out the repo: |
| 181 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 182 | + with: |
| 183 | + persist-credentials: false |
| 184 | + ### Cleanall: |
| 185 | + - run: make cleanall |
| 186 | + ### Install NodeJS |
| 187 | + # Unix (non-Windows): |
| 188 | + - uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 |
| 189 | + if: runner.os != 'Windows' |
| 190 | + - run: make unix-asdf-install |
| 191 | + if: runner.os != 'Windows' |
| 192 | + ### Install the NodeJS packages that we depend on: |
| 193 | + - run: make install-packages |
| 194 | + ### Make sure some other `make` targets don't bitrot: |
| 195 | + - name: Run some other `make` targets to ensure that they don't bitrot |
| 196 | + run: | |
| 197 | + make unix-asdf-install |
| 198 | + make install-packages |
| 199 | + make build |
| 200 | + make pack |
| 201 | + make everything-from-scratch |
| 202 | + - name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot |
| 203 | + run: | |
| 204 | + make clean |
| 205 | + make cleanall |
| 206 | + stalecheck-npm-install: |
| 207 | + # In this job, we are basically trying to check if `package-lock.json` is in |
| 208 | + # sync with `package-lock.json`. |
| 209 | + # |
| 210 | + # So, for example, if someone manually edits the `package.json` file, we want |
| 211 | + # to make sure that the `package-lock.json` file is not out of sync with the |
| 212 | + # `package.json` file. |
| 213 | + timeout-minutes: 30 |
| 214 | + runs-on: ubuntu-latest |
| 215 | + strategy: |
| 216 | + fail-fast: false |
| 217 | + steps: |
| 218 | + ### Check out the repo: |
| 219 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 220 | + with: |
| 221 | + persist-credentials: false |
| 222 | + ### Install NodeJS |
| 223 | + # Unix (non-Windows): |
| 224 | + - uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 |
| 225 | + if: runner.os != 'Windows' |
| 226 | + - run: make unix-asdf-install |
| 227 | + if: runner.os != 'Windows' |
| 228 | + ### Run the master commands for this job: |
| 229 | + - run: make clean |
| 230 | + - run: npm ci |
| 231 | + # - run: npm install --package-lock-only |
| 232 | + - run: npm install |
| 233 | + ### Make sure there are no uncommited changes |
| 234 | + - uses: julia-actions/setup-julia@780022b48dfc0c2c6b94cfee6a9284850107d037 |
| 235 | + with: |
| 236 | + version: '1' |
| 237 | + - run: git --no-pager status |
| 238 | + - run: git --no-pager diff |
| 239 | + - run: julia ./ci/check_uncommitted_changes.jl |
0 commit comments