Skip to content

matrix test

matrix test #301

Workflow file for this run

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: [14,16,18,19,20]
os: [
ubuntu-latest,
macos-12,
windows-latest
]
arch: ["amd64"]
alpine: [false]
exclude:
- os: "macos-14"
arch: "arm64"
node-version: 14
include:
- os: "macos-14"
arch: "arm64"
- os: "ubuntu-latest"
arch: "arm64"
alpine: true
- os: "ubuntu-latest"
arch: "amd64"
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'