diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b60d816..80f4481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,12 +37,18 @@ jobs: - Node.js 19.x - Node.js 20.x - Node.js 21.x + - Node.js 22.x + - Node.js 23.x + - Node.js 24.x + - Node.js 25.x include: - - name: Node.js 0.6 - node-version: "0.6" - npm-i: mocha@1.21.5 - npm-rm: nyc + # Node.js 0.6 is currently disabled: it's a very old runtime and the toolchain/OS + # setup required to run the pipeline needs to be reviewed and maintained separately. + # - name: Node.js 0.6 + # node-version: "0.6" + # npm-i: mocha@1.21.5 + # npm-rm: nyc - name: Node.js 0.8 node-version: "0.8" @@ -131,21 +137,38 @@ jobs: - name: Node.js 21.x node-version: "21.7" + - name: Node.js 22.x + node-version: "22" + + - name: Node.js 23.x + node-version: "23" + + - name: Node.js 24.x + node-version: "24" + + - name: Node.js 25.x + node-version: "25" + steps: - uses: actions/checkout@v3 - name: Install Node.js ${{ matrix.node-version }} shell: bash -eo pipefail -l {0} run: | - if [[ "${{ matrix.node-version }}" == 0.6* ]]; then - sudo sh -c 'echo "deb http://us.archive.ubuntu.com/ubuntu/ bionic universe" >> /etc/apt/sources.list' - sudo sh -c 'echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list' - sudo apt-get update - sudo apt-get install g++-4.8 gcc-4.8 libssl1.0-dev python2 python-is-python2 - export CC=/usr/bin/gcc-4.8 - export CXX=/usr/bin/g++-4.8 - export CXXCOM='$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-narrowing -Wno-strict-overflow $_CCCOMCOM $SOURCES' - fi + # NOTE: Node.js 0.6 is currently disabled. Keeping the setup here commented out as a + # reference; running 0.6 requires an old toolchain/OS packages and should be revisited + # before re-enabling it in the matrix. + # if [[ "${{ matrix.node-version }}" == 0.6* ]]; then + # sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 + # sudo sh -c 'echo "deb http://us.archive.ubuntu.com/ubuntu/ bionic universe" >> /etc/apt/sources.list' + # sudo sh -c 'echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list' + # sudo apt-get update + # sudo apt-get install -y g++-4.8 gcc-4.8 libssl1.0-dev python2.7 + # sudo ln -sf /usr/bin/python2.7 /usr/bin/python + # export CC=/usr/bin/gcc-4.8 + # export CXX=/usr/bin/g++-4.8 + # export CXXCOM='$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-narrowing -Wno-strict-overflow $_CCCOMCOM $SOURCES' + # fi nvm install --default ${{ matrix.node-version }} if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then nvm install --alias=npm 0.10 @@ -213,47 +236,39 @@ jobs: if: steps.list_env.outputs.eslint != '' run: npm run lint - - name: Collect code coverage - if: steps.list_env.outputs.nyc != '' - run: | - if [[ -d ./coverage ]]; then - mv ./coverage "./${{ matrix.name }}" - mkdir ./coverage - mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}" - fi - - name: Upload code coverage uses: actions/upload-artifact@v4 - if: steps.list_env.outputs.nyc != '' + if: steps.list_env.outputs.nyc != '' && hashFiles('coverage/lcov.info') != '' with: - name: coverage - path: ./coverage + name: coverage-node-${{ matrix.node-version }} + path: ./coverage/lcov.info retention-days: 1 coverage: - permissions: - checks: write # for coverallsapp/github-action to create new checks - contents: read # for actions/checkout to fetch code needs: test runs-on: ubuntu-latest + permissions: + contents: read # for actions/checkout to fetch code + checks: write # for coverallsapp/github-action to create new checks steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install lcov shell: bash run: sudo apt-get -y install lcov - name: Collect coverage reports - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v6 with: - name: coverage path: ./coverage + pattern: coverage-node-* - name: Merge coverage reports shell: bash - run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info + run: find ./coverage -type f -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info - name: Upload coverage report uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./lcov.info