tests-installation-iojs.yml
This file
Path
.github/workflows/tests-installation-iojs.yml
142 lines · 5.1 KiB · YAML
Last changed by
[actions] retry apt package installs through Ubuntu mirror outagesJordan Harbandbefore adoption50e73c4
History of this fileTake it
[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
lines 1–41why, one step back1name: 'Tests: installation_iojs'23on: [push, pull_request]45permissions:6 contents: read78jobs:9 installation_iojs_without_curl:10 permissions:11 contents: read1213 name: 'installation_iojs without curl (${{ matrix.shell }})'14 runs-on: ubuntu-latest15 defaults:16 run:17 shell: 'script -q -e -c "${{ matrix.shell }} {0}"'1819 strategy:20 fail-fast: false21 matrix:22 shell:23 - sh24 - bash25 - dash26 - zsh27 # - ksh2829 steps:30 - name: Harden Runner31 uses: step-security/harden-runner@v232 with:33 allowed-endpoints:34 github.com:44335 registry.npmjs.org:44336 raw.githubusercontent.com:44337 nodejs.org:44338 iojs.org:44339 azure.archive.ubuntu.com:8040 packages.microsoft.com:44341 - uses: actions/checkout@v6[actions] fall back to the canonical nvmrc submodule when a fork lacks its ownJordan Harbandbefore adoption77fca77
lines 42–43why, one step back42 id: checkout43 continue-on-error: true[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
lines 44–45why, one step back44 with:45 submodules: true[actions] fall back to the canonical nvmrc submodule when a fork lacks its ownJordan Harbandbefore adoption77fca77
lines 46–52why, one step back46 - name: 'nvmrc submodule fallback (forks without their own nvmrc)'47 if: steps.checkout.outcome == 'failure'48 shell: bash49 run: |50 git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git51 git submodule sync --recursive52 git submodule update --init --recursive[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
lines 53–54why, one step back53 - name: Install zsh and additional shells54 run: |[actions] retry apt package installs through Ubuntu mirror outagesJordan Harbandbefore adoption50e73c4
line 55why, one step back55 PACKAGES='zsh'[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
line 56why, one step back56 if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ] && [ "${{ matrix.shell }}" != "zsh" ]; then[actions] retry apt package installs through Ubuntu mirror outagesJordan Harbandbefore adoption50e73c4
line 57why, one step back57 PACKAGES="${PACKAGES} ${{ matrix.shell }}"[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
line 58why, one step back58 fi[actions] retry apt package installs through Ubuntu mirror outagesJordan Harbandbefore adoption50e73c4
line 59why, one step back59 sh .github/scripts/apt-install.sh ${PACKAGES}[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
lines 60–97why, one step back60 shell: bash61 - run: sudo ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}62 - run: wget --version63 - uses: ljharb/actions/node/install@main64 name: 'npm install && version checks'65 with:66 node-version: 'lts/*'67 skip-ls-check: true68 - run: npm ls urchin69 - run: npx which urchin70 - name: Remove curl71 run: sudo apt-get remove curl -y72 shell: bash73 - run: '! command -v curl'74 shell: bash75 - run: env76 - name: Hide system node77 run: |78 if [ -f /usr/local/bin/node ]; then sudo mv /usr/local/bin/node /usr/local/bin/node.bak; fi79 if [ -f /usr/local/bin/npm ]; then sudo mv /usr/local/bin/npm /usr/local/bin/npm.bak; fi80 if [ -f /usr/local/bin/npx ]; then sudo mv /usr/local/bin/npx /usr/local/bin/npx.bak; fi81 shell: bash82 - name: Run installation_iojs tests83 run: |84 URCHIN_PATH="$(npx which urchin)"85 unset NVM_CD_FLAGS NVM_BIN NVM_INC86 export NVM_DIR="${{ github.workspace }}"87 export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')"88 make TERM=xterm-256color TEST_SUITE="installation_iojs" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}89 - name: Restore system node90 if: always()91 run: |92 if [ -f /usr/local/bin/node.bak ]; then sudo mv /usr/local/bin/node.bak /usr/local/bin/node; fi93 if [ -f /usr/local/bin/npm.bak ]; then sudo mv /usr/local/bin/npm.bak /usr/local/bin/npm; fi94 if [ -f /usr/local/bin/npx.bak ]; then sudo mv /usr/local/bin/npx.bak /usr/local/bin/npx; fi95 shell: bash96 - name: Restore curl97 if: always()[actions] retry apt package installs through Ubuntu mirror outagesJordan Harbandbefore adoption50e73c4
line 98why, one step back98 run: sh .github/scripts/apt-install.sh curl[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
lines 99–100why, one step back99 shell: bash100[Tests] run every remaining test file: exec bits, fixes; add `check-exec` to CIJordan Harbandbefore adoptionc7d5d77
lines 101–134why, one step back101 installation_iojs_source_compile:102 permissions:103 contents: read104105 name: 'actually compile io.js from source (gcc 4.9 container)'106 runs-on: ubuntu-latest107 timeout-minutes: 60108109 steps:110 - name: Harden Runner111 uses: step-security/harden-runner@v2112 with:113 allowed-endpoints:114 github.com:443115 mirror.gcr.io:443116 storage.googleapis.com:443117 iojs.org:443118 - uses: actions/checkout@v6119 # io.js requires python 2 and gcc <= 5 to compile; the gcc:4.9 image120 # (debian jessie) has both, plus curl/wget/xz and CA certificates that121 # still validate iojs.org - so the source-install tests run unmodified,122 # resolving, downloading, checksumming, and compiling for real.123 # The image is pulled through Google's Docker Hub mirror: it serves124 # manifests and blobs from a single stable hostname (Docker Hub's blob125 # CDN hostnames rotate, which the blocked-egress policy can not allow),126 # and it is not subject to Docker Hub's anonymous pull rate limits.127 - name: compile io.js from source, for real128 run: |129 docker run --rm -v "${PWD}:/nvm-under-test" -e NVM_DIR=/nvm-under-test mirror.gcr.io/library/gcc:4.9 bash -ec '130 cd "${NVM_DIR}/test/installation_iojs"131 sh "./install from source"132 sh "./install version specified in .nvmrc from source"133 '134[actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
lines 135–138why, one step back135 all:136 permissions:137 contents: none138 name: 'all installation_iojs tests'[Tests] run every remaining test file: exec bits, fixes; add `check-exec` to CIJordan Harbandbefore adoptionc7d5d77
line 139why, one step back139 needs: [installation_iojs_without_curl, installation_iojs_source_compile][actions] migrate Travis CI tests to GitHub ActionsJordan Harbandbefore adoption4c3edc5
lines 140–142why, one step back140 runs-on: ubuntu-latest141 steps:142 - run: true