musl platform check if linux #307
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
branches: [pact-node-arm64,pact-node] | |
pull_request: | |
branches: [pact-node-arm64,pact-node] | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
strategy: | |
matrix: | |
node-version: [16,20] | |
# node-version: [14,16,18,19,20] | |
os: [ | |
ubuntu-latest, | |
macos-12, | |
macos-14, | |
windows-latest | |
] | |
arch: ["amd64", "arm64"] | |
alpine: [false,true] | |
exclude: | |
- os: "macos-14" | |
arch: "arm64" | |
node-version: 14 | |
- os: "macos-14" | |
arch: "amd64" | |
- os: "ubuntu-latest" | |
arch: "arm64" | |
alpine: false | |
- os: "windows-latest" | |
arch: "arm64" | |
- os: "macos-12" | |
arch: "arm64" | |
- os: "windows-latest" | |
alpine: true | |
- os: "macos-12" | |
alpine: true | |
- os: "macos-14" | |
alpine: true | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Set up QEMU | |
if: matrix.arch == 'arm64' && matrix.alpine == true | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
if: matrix.arch == 'arm64' && matrix.alpine == true | |
uses: docker/setup-buildx-action@v3 | |
- run: script/ci/build-and-test.sh | |
if: matrix.arch != 'alpine' | |
shell: bash | |
env: | |
NODE_VERSION: ${{ matrix.node-version }} | |
- name: test alpine ${{ matrix.arch }} package | |
if: ${{ matrix.alpine == true }} | |
run: docker run --platform=linux/${{ matrix.arch }} -e NODE_VERSION=${{ matrix.node-version }} --rm -v $(pwd):/app node:${{ matrix.node-version }}-alpine /bin/sh -c 'apk add --no-cache bash && cd /app && ./script/ci/build-and-test.sh' | |