Skip to content

Commit

Permalink
wip(ci): test big ol include matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Feb 12, 2024
1 parent 4104a3f commit 9b5e983
Showing 1 changed file with 62 additions and 77 deletions.
139 changes: 62 additions & 77 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,68 @@ jobs:
strategy:
fail-fast: false
matrix:
# musl: [false]
# docker: [false]
node-version: [16,18,20]
os: [
# macos-14,
# macos-12,
ubuntu-latest,
# windows-latest
]

env:
NODE_VERSION: ${{ matrix.node-version }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- if: runner.os == 'Windows'
run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV


- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: runner.os == 'Linux'
uses: docker/setup-buildx-action@v3
- if: runner.os == 'Linux'
name: prebuild linux amd64 musl
run: docker run -v $PWD:/home --platform linux/amd64 --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash && cd /home && /home/script/ci/prebuild-alpine.sh && rm -rf ffi node_modules'
- if: runner.os == 'Linux'
name: prebuild linux arm64 musl
run: docker run -v $PWD:/home --platform linux/arm64 --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash && cd /home && /home/script/ci/prebuild-alpine.sh && rm -rf ffi node_modules'
- if: runner.os == 'Linux'
name: prebuild linux arm64
run: docker run -v $PWD:/home --platform linux/arm64 --rm node:${{ matrix.node-version }} bin/bash -c 'cd /home && /home/script/ci/prebuild.sh && rm -rf ffi node_modules'
- run: sudo chown -R $(id -u):$(id -g) prebuilds
if: runner.os == 'Linux'
- run: ./script/ci/prebuild.sh
- name: Upload prebuild for ${{ runner.os }}-${{ runner.arch }}
uses: actions/upload-artifact@v3
with:
path: prebuilds/*.tar.gz

# - run: GH_PRE_RELEASE_UPLOAD=true ./script/ci/release.sh
# if: github.ref == 'refs/heads/master' && env.ACT != 'true'
# env:
# GITHUB_TOKEN: ${{ github.token }}

test:
runs-on: ${{ matrix.os }}
needs: [prebuild]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
arch: amd64
Expand Down Expand Up @@ -60,7 +120,6 @@ jobs:
musl: true
docker: true
node-version: 16

- os: macos-14
arch: amd64
node-version: 18
Expand Down Expand Up @@ -90,7 +149,6 @@ jobs:
musl: true
docker: true
node-version: 18

- os: macos-14
arch: amd64
node-version: 20
Expand Down Expand Up @@ -123,79 +181,6 @@ jobs:
env:
NODE_VERSION: ${{ matrix.node-version }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- if: runner.os == 'Windows'
run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV


- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: runner.os == 'Linux'
uses: docker/setup-buildx-action@v3
- if: runner.os == 'Linux'
name: prebuild linux amd64 musl
run: docker run -v $PWD:/home --platform linux/amd64 --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash && cd /home && /home/script/ci/prebuild-alpine.sh && rm -rf ffi node_modules'
- if: runner.os == 'Linux'
name: prebuild linux arm64 musl
run: docker run -v $PWD:/home --platform linux/arm64 --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash && cd /home && /home/script/ci/prebuild-alpine.sh && rm -rf ffi node_modules'
- if: runner.os == 'Linux'
name: prebuild linux arm64
run: docker run -v $PWD:/home --platform linux/arm64 --rm node:${{ matrix.node-version }} bin/bash -c 'cd /home && /home/script/ci/prebuild.sh && rm -rf ffi node_modules'
- run: sudo chown -R $(id -u):$(id -g) prebuilds
if: runner.os == 'Linux'
- run: ./script/ci/prebuild.sh
- name: Upload prebuild for ${{ runner.os }}-${{ runner.arch }}
uses: actions/upload-artifact@v3
with:
path: prebuilds/*.tar.gz

# - run: GH_PRE_RELEASE_UPLOAD=true ./script/ci/release.sh
# if: github.ref == 'refs/heads/master' && env.ACT != 'true'
# env:
# GITHUB_TOKEN: ${{ github.token }}

test:
runs-on: ${{ matrix.os }}
needs: [prebuild]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
node-version: [16,18,20]
# os: [
# # macos-14,
# # macos-12,
# ubuntu-latest,
# # windows-latest
# ]
include:
- os: ubuntu-latest
musl: false
arch: amd64
docker: true
- os: ubuntu-latest
musl: true
arch: amd64
- os: ubuntu-latest
musl: true
arch: arm64
docker: true
env:
NODE_VERSION: ${{ matrix.node-version }}

steps:
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 9b5e983

Please sign in to comment.