From fae680f740b9f1926e875aabd5cea33950c2edbc Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 5 Sep 2019 15:56:12 +0200 Subject: [PATCH] build: drop Travis in favor of Actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub Actions is running all tests already present on Travis, as well as building on more platforms (OS X and Windows). With Travis we're also getting timeouts more frequently than with Actions, which gives the false impression tests are failing (making it harder to triage PRs ready to merge). To make our config simpler, CI.yml and pythonpackage.yml got merged. The coverage is also increased by running tests on OS X. Signed-off-by: Matheus Marchini Backport-PR-URL: https://github.com/nodejs/node/pull/32608 PR-URL: https://github.com/nodejs/node/pull/32450 Reviewed-By: Richard Lau Reviewed-By: Christian Clauss Reviewed-By: Jiawen Geng Reviewed-By: Matteo Collina Reviewed-By: Ben Coe Reviewed-By: Tobias Nießen Reviewed-By: Michaël Zasso --- .github/workflows/CI.yml | 79 ------------------------- .github/workflows/build-windows.yml | 23 ++++++++ .github/workflows/linters.yml | 73 +++++++++++++++++++++++ .github/workflows/misc.yml | 24 ++++++++ .github/workflows/test-linux.yml | 23 ++++++++ .github/workflows/test-macos.yml | 23 ++++++++ .gitignore | 1 - .travis.yml | 91 ----------------------------- doc/guides/collaborator-guide.md | 9 +-- 9 files changed, 167 insertions(+), 179 deletions(-) delete mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/build-windows.yml create mode 100644 .github/workflows/linters.yml create mode 100644 .github/workflows/misc.yml create mode 100644 .github/workflows/test-linux.yml create mode 100644 .github/workflows/test-macos.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index f5b6281149c0fb..00000000000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - build-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: NODE=$(which node) make doc-only - - uses: actions/upload-artifact@v1 - with: - name: docs - path: out/doc - build-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Environment Information - run: npx envinfo - - name: Build - run: ./configure && make -j2 - build-windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Environment Information - run: npx envinfo - - name: Install deps - run: choco install nasm - - name: Build - run: ./vcbuild.bat - build-macOS: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Environment Information - run: npx envinfo - - name: Build - run: ./configure && make -j8 - lint-addon-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 10 - uses: actions/setup-node@v1 - with: - node-version: 10.x - - name: Lint addon docs - run: NODE=$(which node) make lint-addon-docs - lint-cpp: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Lint C/C++ files - run: make lint-cpp - lint-md: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 10 - uses: actions/setup-node@v1 - with: - node-version: 10.x - - name: Lint docs - run: | - echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" - NODE=$(which node) make lint-md - lint-js: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 10 - uses: actions/setup-node@v1 - with: - node-version: 10.x - - name: Lint JavaScript files - run: NODE=$(which node) make lint-js diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 00000000000000..7d7a8167308960 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,23 @@ +name: build-windows + +on: [push, pull_request] + +env: + PYTHON_VERSION: 2.7 + FLAKY_TESTS: dontcare + +jobs: + build-windows: + runs-on: windows-2016 + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v1 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Install deps + run: choco install nasm + - name: Environment Information + run: npx envinfo + - name: Build + run: ./vcbuild.bat diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 00000000000000..f0ee528a0f4e0f --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,73 @@ +name: linters + +on: [push, pull_request] + +env: + PYTHON_VERSION: 3.8 + NODE_VERSION: 10.x + +jobs: + lint-addon-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Lint addon docs + run: NODE=$(which node) make lint-addon-docs + lint-cpp: + 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: Lint C/C++ files + run: make lint-cpp + lint-md: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Lint docs + run: | + echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" + NODE=$(which node) make lint-md + lint-js: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Lint JavaScript files + run: NODE=$(which node) make lint-js + lint-py: + 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: Lint Python + run: | + make lint-py-build || true + NODE=$(which node) make lint lint-py diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml new file mode 100644 index 00000000000000..b23120ae0f1d74 --- /dev/null +++ b/.github/workflows/misc.yml @@ -0,0 +1,24 @@ +name: misc + +on: [push, pull_request] + +env: + NODE_VERSION: 12.x + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Environment Information + run: npx envinfo + - name: Build + run: NODE=$(which node) make doc-only + - uses: actions/upload-artifact@v1 + with: + name: docs + path: out/doc diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml new file mode 100644 index 00000000000000..d63627f1f0cc78 --- /dev/null +++ b/.github/workflows/test-linux.yml @@ -0,0 +1,23 @@ +name: test-linux + +on: [push, pull_request] + +env: + PYTHON_VERSION: 2.7 + FLAKY_TESTS: dontcare + +jobs: + test-linux: + 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: Build + run: make build-ci -j2 V=1 + - name: Test + run: make run-ci -j2 V=1 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml new file mode 100644 index 00000000000000..51dfc3d245e01c --- /dev/null +++ b/.github/workflows/test-macos.yml @@ -0,0 +1,23 @@ +name: test-macOS + +on: [push, pull_request] + +env: + PYTHON_VERSION: 2.7 + FLAKY_TESTS: dontcare + +jobs: + test-macOS: + 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: Build + run: make build-ci -j8 V=1 + - name: Test + run: make run-ci -j8 V=1 diff --git a/.gitignore b/.gitignore index 9864e6780b3bbd..f0e9b6b15d4c69 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,6 @@ !.gitkeep !.mailmap !.nycrc -!.travis.yml !.eslintrc.yaml !.cpplint diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e1069317ecc2c5..00000000000000 --- a/.travis.yml +++ /dev/null @@ -1,91 +0,0 @@ -os: linux -language: cpp -# Currently this file can only support one PYTHON_VERSION. -# To experiment with Python 3, comment out Python 2.7 and uncomment one of the Python 3 versions. -env: - global: - - PYTHON_VERSION="2.7.15" - # - PYTHON_VERSION="3.6.7" - # - PYTHON_VERSION="3.7.1" -jobs: - include: - - stage: "Compile" - name: "Compile Node.js" - cache: ccache - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - install: - - export CCACHE_NOSTATS=1 - - export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches" - - export CC='ccache gcc-6' - - export CXX='ccache g++-6' - script: - - pyenv global ${PYTHON_VERSION} - - ./configure - - timeout --preserve-status 45m make -j2 V=1 - before_cache: - - cp out/Release/node /home/travis/.ccache - - cp out/Release/cctest /home/travis/.ccache - - - stage: "Tests" - name: "Test JS Suites" - cache: ccache - install: - - mkdir -p out/Release - - cp /home/travis/.ccache/node out/Release/node - script: - - pyenv global ${PYTHON_VERSION} - - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default - - - name: "Test C++ Suites" - cache: ccache - install: - - export CCACHE_NOSTATS=1 - - export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches" - - export CC='ccache gcc' - - export CXX='ccache g++' - - mkdir -p out/Release - - cp /home/travis/.ccache/node out/Release/node - - ln -fs out/Release/node node - - cp /home/travis/.ccache/cctest out/Release/cctest - - touch config.gypi - script: - - pyenv global ${PYTHON_VERSION} - - out/Release/cctest - - make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp - - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api - - - name: "Run Linter and Build Docs" - language: node_js - node_js: "node" - install: - - pyenv global ${PYTHON_VERSION} - - make lint-py-build || true - script: - - NODE=$(which node) make lint-py doc-only lint - - - name: "First commit message adheres to guidelines at https://goo.gl/p2fr5Q" - if: type = pull_request - language: node_js - node_js: "node" - script: - - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then - bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST}; - fi - - - name: "Find syntax errors in our Python dependencies" - language: python - python: 3.8 - install: - - mv .flake8 disabled.flake8 # take the blinders off of flake8 - - python3.8 -m pip install --upgrade pip - - python3.8 -m pip install flake8 - script: - - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - allow_failures: # TODO (cclauss): remove this when dependencies are clean - - name: "Find syntax errors in our Python dependencies" - - name: "First commit message adheres to guidelines at https://goo.gl/p2fr5Q" diff --git a/doc/guides/collaborator-guide.md b/doc/guides/collaborator-guide.md index 7e887d7543f50a..956eae7fb23726 100644 --- a/doc/guides/collaborator-guide.md +++ b/doc/guides/collaborator-guide.md @@ -175,14 +175,7 @@ fail before the change, and pass after the change. All pull requests must pass continuous integration tests. Code changes must pass on [project CI server](https://ci.nodejs.org/). Pull requests that only change -documentation and comments can use Travis CI results. - -Travis CI jobs have a fixed running time limit that building Node.js sometimes -exceeds. If the `Compile Node.js` Travis CI job has timed out it will fail after -around 45 minutes. The exit code will be 143, indicating that a `SIGTERM` signal -terminated the `make` command. When this happens, restart the timed out job. It -will reuse built artifacts from the previous timed-out run, and thus take less -time to complete. +documentation and comments can use GitHub Actions results. Do not land any pull requests without passing (green or yellow) CI runs. If there are CI failures unrelated to the change in the pull request, try "Resume