Skip to content
Myr

tests-xenial.yml

This file

Path

.github/workflows/tests-xenial.yml

125 lines · 4.2 KiB · YAML

Last changed by

[actions] cache container images, verified against digests looked up liveJordan Harbandbefore adoption5c05fb6

History of this file

Take it

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

lines 1–40why, one step back
1name: 'Tests: xenial'
23on: [push, pull_request]45permissions:6 contents: read78jobs:9 xenial:10 permissions:11 contents: read1213 name: 'xenial (${{ matrix.shell }})'14 runs-on: ubuntu-latest1516 strategy:17 fail-fast: false18 matrix:19 shell:20 - sh21 - bash22 - dash23 - zsh24 # - ksh2526 steps:27 - name: Harden Runner28 uses: step-security/harden-runner@v229 with:30 allowed-endpoints:31 github.com:44332 registry.npmjs.org:44333 raw.githubusercontent.com:44334 nodejs.org:44335 iojs.org:44336 azure.archive.ubuntu.com:8037 packages.microsoft.com:44338 archive.ubuntu.com:8039 security.ubuntu.com:8040 production.cloudflare.docker.com:443

[actions] allow DockerHub's CloudFront CDN so image pulls aren't blockedJordan Harbandbefore adoptionc4d9239

line 41why, one step back
41 production.cloudfront.docker.com:443

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

lines 42–43why, one step back
42 registry-1.docker.io:443
43 auth.docker.io:443

[actions] pull container images through Google's Docker Hub mirrorJordan Harbandbefore adoption37be73f

line 44why, one step back
44 mirror.gcr.io:443

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

line 45why, one step back
45 - uses: actions/checkout@v6

[actions] fall back to the canonical nvmrc submodule when a fork lacks its ownJordan Harbandbefore adoption77fca77

lines 46–47why, one step back
46 id: checkout
47 continue-on-error: true

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

lines 48–49why, one step back
48 with:
49 submodules: true

[actions] fall back to the canonical nvmrc submodule when a fork lacks its ownJordan Harbandbefore adoption77fca77

lines 50–56why, one step back
50 - name: 'nvmrc submodule fallback (forks without their own nvmrc)'
51 if: steps.checkout.outcome == 'failure'52 shell: bash53 run: |54 git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git55 git submodule sync --recursive56 git submodule update --init --recursive

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

lines 57–63why, one step back
57 - uses: ljharb/actions/node/install@main
58 name: 'npm install && version checks'59 with:60 node-version: 'lts/*'61 skip-ls-check: true62 - run: npm ls urchin63 - run: npx which urchin

[actions] cache container images, verified against digests looked up liveJordan Harbandbefore adoption5c05fb6

lines 64–77why, one step back
64 # Pull through Google's Docker Hub mirror, which is not subject to Docker Hub's
65 # anonymous pull rate limits, and cache the image; a cached image is only used66 # if it matches the digests the registry serves now67 - name: Resolve the ubuntu:16.04 image digests68 id: image69 run: sh .github/scripts/docker-image.sh resolve mirror.gcr.io/library/ubuntu:16.04 >> "$GITHUB_OUTPUT"70 - uses: actions/cache@v671 with:72 path: ${{ runner.temp }}/docker-image.tar73 key: docker-image-${{ runner.arch }}-${{ steps.image.outputs.key }}74 - name: Load or pull the ubuntu:16.04 image75 env:76 DIGESTS: ${{ steps.image.outputs.digests }}77 run: sh .github/scripts/docker-image.sh ensure mirror.gcr.io/library/ubuntu:16.04 "${RUNNER_TEMP}/docker-image.tar"

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

lines 78–86why, one step back
78 - name: Run xenial tests in container
79 run: |80 docker run --rm \81 -v "${{ github.workspace }}:/workspace" \82 -w /workspace \83 -e "TEST_SHELL=${{ matrix.shell }}" \84 -e "TERM=xterm-256color" \85 -e "DEBIAN_FRONTEND=noninteractive" \86 -e "GITHUB_ACTIONS=true" \

[actions] pull container images through Google's Docker Hub mirrorJordan Harbandbefore adoption37be73f

line 87why, one step back
87 mirror.gcr.io/library/ubuntu:16.04 \

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

lines 88–90why, one step back
88 bash -c '
89 set -ex90

[actions] retry apt package installs through Ubuntu mirror outagesJordan Harbandbefore adoption50e73c4

line 91why, one step back
91 sh /workspace/.github/scripts/apt-install.sh git curl wget make build-essential python zsh libssl-dev

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

line 92why, one step back
92 if [ "$TEST_SHELL" != "sh" ] && [ "$TEST_SHELL" != "bash" ]; then

[actions] retry apt package installs through Ubuntu mirror outagesJordan Harbandbefore adoption50e73c4

line 93why, one step back
93 sh /workspace/.github/scripts/apt-install.sh $TEST_SHELL || true

[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5

lines 94–125why, one step back
94 fi
9596 # Use nvm to install Node.js for running urchin97 # Node 16 is the last version supporting GLIBC 2.23 (Ubuntu 16.04)98 export NVM_DIR="/workspace"99 . /workspace/nvm.sh100 nvm install 16101 nvm use 16102103 npm ls urchin104 URCHIN_PATH="$(npx which urchin)"105106 # Now clean up nvm state for the actual tests, but keep NVM_DIR set107 nvm deactivate || true108 nvm unalias default || true109 unset NVM_CD_FLAGS NVM_BIN NVM_INC110 export PATH="$(echo "$PATH" | tr ":" "\n" | grep -v "\.nvm" | grep -v "toolcache" | tr "\n" ":")"111112 # Clean any cached files from the nvm install above113 rm -rf "$NVM_DIR/.cache" "$NVM_DIR/versions" "$NVM_DIR/alias"114115 make TEST_SUITE="xenial" SHELL="$TEST_SHELL" URCHIN="$URCHIN_PATH" test-$TEST_SHELL116 '117118 all:119 permissions:120 contents: none121 name: 'all xenial tests'122 needs: [xenial]123 runs-on: ubuntu-latest124 steps:125 - run: true