From 78658afb2b7a18d45c8a7e86cd2401c656e08ef4 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Fri, 6 Mar 2020 10:56:33 -0500 Subject: [PATCH 1/4] build: add build from tarball Resolves: https://github.com/nodejs/build/issues/1931 --- .github/workflows/build-tarball.yml | 137 ++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 .github/workflows/build-tarball.yml diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml new file mode 100644 index 00000000000000..62c668b0f91176 --- /dev/null +++ b/.github/workflows/build-tarball.yml @@ -0,0 +1,137 @@ +name: Build from tarball + +on: [push, pull_request] + +env: + PYTHON_VERSION: 3.8 + FLAKY_TESTS: dontcare + +jobs: + build-tarball: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v1 + with: + PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Make tarball + run: | + export DISTTYPE=nightly + export DATESTRING=`date "+%Y-%m-%d"` + export COMMIT=xxxx + ./configure && make tar -j8 + mkdir tarballs + mv *.tar.gz tarballs + - name: Upload tarball artifact + uses: actions/upload-artifact@v1 + with: + name: tarballs + path: tarballs + test-tarball-linux: + needs: build-tarball + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v1 + with: + PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Download tarball + uses: actions/download-artifact@v1 + with: + name: tarballs + - name: Extract tarball + run: | + tar xzf tarballs/*.tar.gz + echo "::set-env name=TAR_DIR::`basename tarballs/*.tar.gz .tar.gz`" + - name: Copy directories needed for testing + run: | + cp -r tools/node_modules $TAR_DIR/tools + cp -r tools/eslint-rules $TAR_DIR/tools + - name: Build + run: | + cd $TAR_DIR + make build-ci -j2 V=1 + - name: Test + run: | + cd $TAR_DIR + make run-ci -j2 V=1 + test-tarball-windows: + needs: build-tarball + runs-on: windows-latest + steps: + - name: Set up autocrlf + run: | + git config --global core.autocrlf true + - uses: actions/checkout@v2 + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v1 + with: + PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Download tarball + uses: actions/download-artifact@v1 + with: + name: tarballs + - name: Extract tarball + run: | + 7z x tarballs/*.tar.gz + 7z x *.tar -ttar + - name: Install deps + run: choco install nasm + - name: Build + run: | + $env:DEBUG_HELPER=1 + $tarfile = dir *.tar + cd $tarfile.BaseName + $env:msbuild_args="/binaryLogger:node.binlog" + ./vcbuild.bat x64 release msi + echo "::set-env name=TAR_DIR::$pwd" + echo "::set-env name=test_ci_args::--shell=$pwd\out\Release\node.exe" + - name: "Test JS Suites" + shell: cmd + run: | + set DEBUG_HELPER=1 + ./vcbuild.bat release noprojgen nobuild ignore-flaky test-ci-js + - name: "Test C++ Suites" + shell: cmd + run: | + set DEBUG_HELPER=1 + ./vcbuild.bat release noprojgen nobuild ignore-flaky test-ci-native + test-tarball-macOS: + needs: build-tarball + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v1 + with: + PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Download tarball + uses: actions/download-artifact@v1 + with: + name: tarballs + - name: Extract tarball + run: | + tar xzf tarballs/*.tar.gz + echo "::set-env name=TAR_DIR::`basename tarballs/*.tar.gz .tar.gz`" + - name: Copy directories needed for testing + run: | + cp -r tools/node_modules $TAR_DIR/tools + cp -r tools/eslint-rules $TAR_DIR/tools + - name: Build + run: | + cd $TAR_DIR + make build-ci -j8 V=1 + - name: Test + run: | + cd $TAR_DIR + make run-ci -j8 V=1 \ No newline at end of file From bbdf382800a4f7a8e676aa188af358085928a7af Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 7 Apr 2020 11:06:32 -0400 Subject: [PATCH 2/4] test: use symlinks to copy shells Git for Windows includes C:\Program Files\Git\bin\bash.exe which spawns ..\usr\bin\bash.exe so copying that executable won't work. However if a symlink is used to test paths with spaces this executable will still work. --- test/parallel/test-child-process-exec-any-shells-windows.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 8cdd03d7e510d5..0e78b665689720 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -23,10 +23,10 @@ const test = (shell) => { })); }; const testCopy = (shellName, shellPath) => { - // Copy the executable to a path with spaces, to ensure there are no issues + // Symlink the executable to a path with spaces, to ensure there are no issues // related to quoting of argv0 const copyPath = `${tmpPath}\\${shellName}`; - fs.copyFileSync(shellPath, copyPath); + fs.symlinkSync(shellPath, copyPath); test(copyPath); }; From 67d4d2bb0def83afe1193ec186915b51f2b6ebac Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 7 Apr 2020 17:05:29 -0400 Subject: [PATCH 3/4] Use Python 2.7 for Windows testing --- .github/workflows/build-tarball.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 62c668b0f91176..1e244cc7a19728 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -3,18 +3,19 @@ name: Build from tarball on: [push, pull_request] env: - PYTHON_VERSION: 3.8 FLAKY_TESTS: dontcare jobs: build-tarball: + env: + PYTHON_VERSION: 3.8 runs-on: macos-latest steps: - uses: actions/checkout@v2 - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v1 with: - PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information run: npx envinfo - name: Make tarball @@ -31,6 +32,8 @@ jobs: name: tarballs path: tarballs test-tarball-linux: + env: + PYTHON_VERSION: 3.8 needs: build-tarball runs-on: ubuntu-latest steps: @@ -38,7 +41,7 @@ jobs: - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v1 with: - PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information run: npx envinfo - name: Download tarball @@ -69,10 +72,10 @@ jobs: run: | git config --global core.autocrlf true - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} + - name: Set up Python 2.7 uses: actions/setup-python@v1 with: - PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + python-version: 2.7 - name: Environment Information run: npx envinfo - name: Download tarball From f5dc4d2179433b7f1334c8d0022befaf2549f65a Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 8 Apr 2020 10:00:14 -0400 Subject: [PATCH 4/4] Move built release to checkout dir --- .github/workflows/build-tarball.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 1e244cc7a19728..04a451a8309235 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -96,7 +96,8 @@ jobs: $env:msbuild_args="/binaryLogger:node.binlog" ./vcbuild.bat x64 release msi echo "::set-env name=TAR_DIR::$pwd" - echo "::set-env name=test_ci_args::--shell=$pwd\out\Release\node.exe" + - name: Copy out directory to checkout dir + run: Move-Item -Path "$env:TAR_DIR\out" -Destination "$env:GITHUB_WORKSPACE" - name: "Test JS Suites" shell: cmd run: |