Add support for goma #187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: node | |
on: | |
push: | |
schedule: | |
- cron: '0 21 * * *' | |
env: | |
WIN_SDK_VERSION: 22621 | |
jobs: | |
build: | |
runs-on: ${{ fromJson('{"linux":"ubuntu-22.04","mac":"macos-12","win":"windows-2022"}')[matrix.targetOs] }} | |
continue-on-error: false | |
strategy: | |
fail-fast: false | |
matrix: | |
targetOs: [linux, mac, win] | |
arch: [x64, arm64] | |
include: | |
- targetOs: linux | |
arch: x86 | |
- targetOs: win | |
arch: x86 | |
steps: | |
- name: Prepare to Install Linux Dependencies | |
if: runner.os == 'Linux' | |
run: sudo apt update | |
- name: Install Linux Cross Compilation Toolchains | |
if: runner.os == 'linux' && matrix.arch != 'x64' | |
run: sudo apt install -y gcc-multilib g++-multilib | |
- name: Install Linux Arm Toolchains | |
if: matrix.targetOs == 'linux' && startsWith(matrix.arch, 'arm') | |
run: sudo apt install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross linux-libc-dev-armhf-cross binutils-aarch64-linux-gnu | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup GOMA | |
shell: bash | |
env: | |
SECRET_FILE_CONTENT: ${{ secrets.GOMA_OAUTH2_CONFIG }} | |
run: | | |
printf "$SECRET_FILE_CONTENT" > ~/.goma_oauth2_config | |
- name: Build | |
run: | | |
node scripts/bootstrap.js --goma --target-os=${{ matrix.targetOs }} --target-cpu=${{ matrix.arch }} --node-repo=https://github.com/zcbenz/node --node-commit=pending-patches | |
node scripts/build.js | |
- name: Run Tests | |
if: matrix.arch == 'x64' && (matrix.targetOs == 'linux' || matrix.targetOs == 'mac') | |
run: | | |
# Build tests. | |
node scripts/build.js node_cctest node_embedtest overlapped_checker | |
# Build native addons used for testing. | |
BUILD_ADDONS_ARGS="--config-gypi-path=`pwd`/out/Release/gen/node/config.gypi --root-dir=`pwd`/node" | |
python node/tools/build_addons.py node/test/addons --skip-tests=openssl-client-cert-engine,openssl-key-engine,openssl-test-engine $BUILD_ADDONS_ARGS | |
python node/tools/build_addons.py node/test/node-api $BUILD_ADDONS_ARGS | |
python node/tools/build_addons.py node/test/js-native-api $BUILD_ADDONS_ARGS | |
# Run tests. | |
cd node | |
../out/Release/node_cctest | |
../out/Release/node test/embedding/test-embedding.js | |
./tools/test.py --shell ../out/Release/node js-native-api | |
./tools/test.py --shell ../out/Release/node node-api | |
# TODO(zcbenz): The parallel/test-crypto-no-algorithm test is failing, | |
# which was introduced by https://github.com/nodejs/node/pull/46237, I | |
# don't have enough experience with OpenSSL to fix it. | |
./tools/test.py --shell ../out/Release/node --flaky-tests=dontcare --skip-tests=parallel/test-crypto-no-algorithm | |
notify-build-failure: | |
needs: [build] | |
if: failure() && github.event.schedule != null | |
permissions: | |
issues: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: jayqi/failed-build-issue-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} |