Skip to content

Commit

Permalink
ci: isolate windows
Browse files Browse the repository at this point in the history
  • Loading branch information
metcoder95 committed Nov 27, 2024
1 parent 48f4546 commit da7e78b
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 128 deletions.
228 changes: 114 additions & 114 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,136 +62,136 @@ jobs:
- 22
- 23
runs-on:
- ubuntu-latest
# - ubuntu-latest
- windows-latest
- macos-latest
# - macos-latest
uses: ./.github/workflows/test.yml
with:
node-version: ${{ matrix.node-version }}
runs-on: ${{ matrix.runs-on }}
secrets: inherit

test-without-intl:
name: Test with Node.js ${{ matrix.version }} compiled --without-intl
strategy:
fail-fast: false
max-parallel: 0
matrix:
version: [20, 22, 23]
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
persist-credentials: false

# Setup node, install deps, and build undici prior to building icu-less node and testing
- name: Setup Node.js@${{ inputs.version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ inputs.version }}

- name: Install dependencies
run: npm install

- name: Build undici
run: npm run build:node

- name: Determine latest release
id: release
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
result-encoding: string
script: |
const req = await fetch('https://nodejs.org/download/release/index.json')
const releases = await req.json()
const latest = releases.find((r) => r.version.startsWith('v${{ matrix.version }}'))
return latest.version
- name: Download and extract source
run: curl https://nodejs.org/download/release/${{ steps.release.outputs.result }}/node-${{ steps.release.outputs.result }}.tar.xz | tar xfJ -

- name: Install ninja
run: sudo apt-get install ninja-build

- name: ccache
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 #v1.2.14
with:
key: node${{ matrix.version }}

- name: Build node
working-directory: ./node-${{ steps.release.outputs.result }}
run: |
export CC="ccache gcc"
export CXX="ccache g++"
./configure --without-intl --ninja --prefix=./final
make
make install
echo "$(pwd)/final/bin" >> $GITHUB_PATH
- name: Print version information
run: |
echo OS: $(node -p "os.version()")
echo Node.js: $(node --version)
echo npm: $(npm --version)
echo git: $(git --version)
echo icu config: $(node -e "console.log(process.config)" | grep icu)
- name: Run tests
run: npm run test:javascript:without-intl

test-fuzzing:
name: Fuzzing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*

- name: Install dependencies
run: npm install

- name: Run fuzzing tests
run: npm run test:fuzzing

test-types:
name: Test TypeScript types
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
# test-without-intl:
# name: Test with Node.js ${{ matrix.version }} compiled --without-intl
# strategy:
# fail-fast: false
# max-parallel: 0
# matrix:
# version: [20, 22, 23]
# runs-on: ubuntu-latest
# timeout-minutes: 120
# steps:
# - name: Checkout
# uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# with:
# persist-credentials: false

# # Setup node, install deps, and build undici prior to building icu-less node and testing
# - name: Setup Node.js@${{ inputs.version }}
# uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
# with:
# node-version: ${{ inputs.version }}

# - name: Install dependencies
# run: npm install

# - name: Build undici
# run: npm run build:node

# - name: Determine latest release
# id: release
# uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
# with:
# result-encoding: string
# script: |
# const req = await fetch('https://nodejs.org/download/release/index.json')
# const releases = await req.json()

# const latest = releases.find((r) => r.version.startsWith('v${{ matrix.version }}'))
# return latest.version

# - name: Download and extract source
# run: curl https://nodejs.org/download/release/${{ steps.release.outputs.result }}/node-${{ steps.release.outputs.result }}.tar.xz | tar xfJ -

# - name: Install ninja
# run: sudo apt-get install ninja-build

# - name: ccache
# uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 #v1.2.14
# with:
# key: node${{ matrix.version }}

# - name: Build node
# working-directory: ./node-${{ steps.release.outputs.result }}
# run: |
# export CC="ccache gcc"
# export CXX="ccache g++"
# ./configure --without-intl --ninja --prefix=./final
# make
# make install
# echo "$(pwd)/final/bin" >> $GITHUB_PATH

# - name: Print version information
# run: |
# echo OS: $(node -p "os.version()")
# echo Node.js: $(node --version)
# echo npm: $(npm --version)
# echo git: $(git --version)
# echo icu config: $(node -e "console.log(process.config)" | grep icu)

# - name: Run tests
# run: npm run test:javascript:without-intl

# test-fuzzing:
# name: Fuzzing
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# with:
# persist-credentials: false

# - name: Setup Node.js
# uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
# with:
# node-version: lts/*

# - name: Install dependencies
# run: npm install

# - name: Run fuzzing tests
# run: npm run test:fuzzing

# test-types:
# name: Test TypeScript types
# timeout-minutes: 15
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# with:
# persist-credentials: false

# - name: Setup Node.js
# uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
# with:
# node-version: lts/*

- name: Install dependencies
run: npm install
# - name: Install dependencies
# run: npm install

- name: Run typings tests
run: npm run test:typescript
# - name: Run typings tests
# run: npm run test:typescript

automerge:
if: >
github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]'
needs:
- dependency-review
- test
- test-types
- test-without-intl
- test-fuzzing
# - test-types
# - test-without-intl
# - test-fuzzing
- lint
runs-on: ubuntu-latest
permissions:
Expand Down
29 changes: 15 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
runs-on:
required: true
type: string
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -43,22 +44,22 @@ jobs:
run: npm ls --all
continue-on-error: true

- name: Run tests with coverage
id: coverage
if: inputs.runs-on == 'ubuntu-latest' && inputs.node-version == 22
run: npm run coverage:ci
env:
CI: true
NODE_V8_COVERAGE: ./coverage/tmp
# - name: Run tests with coverage
# id: coverage
# if: inputs.runs-on == 'ubuntu-latest' && inputs.node-version == 22
# run: npm run coverage:ci
# env:
# CI: true
# NODE_V8_COVERAGE: ./coverage/tmp

- name: Run tests
if: steps.coverage.outcome == 'skipped'
run: npm run test:javascript
# if: steps.coverage.outcome == 'skipped'
run: npm run test:h2:core -- --only
env:
CI: true

- name: Coverage Report
if: inputs.runs-on == 'ubuntu-latest' && inputs.node-version == 20
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Coverage Report
# if: inputs.runs-on == 'ubuntu-latest' && inputs.node-version == 20
# uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit da7e78b

Please sign in to comment.