forked from pact-foundation/pact-ruby-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 1.95 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
- name: Set up environment
run: bundle install
- name: Build
run: bundle exec rake package
- name: Show standalone packages
run: ls pkg
- name: Upload standalone packages
uses: actions/upload-artifact@v3
with:
name: pkg
path: pkg
test:
defaults:
run:
shell: sh
needs: [build]
strategy:
fail-fast: false
matrix:
os: ["windows-latest","ubuntu-latest","macos-12"]
arch: ["amd64"]
alpine: [false]
include:
- os: "macos-14"
arch: "arm64"
- os: "ubuntu-latest"
arch: "arm64"
alpine: true
- os: "ubuntu-latest"
arch: "amd64"
alpine: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- 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
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: test ${{ matrix.os }} package
if: ${{ matrix.alpine == false }}
run: ./script/unpack-and-test.sh
- name: test alpine ${{ matrix.arch }} package
if: ${{ matrix.alpine == true }}
run: docker run --platform=linux/${{ matrix.arch }} --rm -v $(pwd):/app alpine /bin/sh -c 'apk add --no-cache bash && cd /app && ./script/unpack-and-test.sh'
- name: test x86 package
if: ${{ runner.os == 'Windows'}}
run: ./script/unpack-and-test.sh
env:
BINARY_OS: 'windows'
BINARY_ARCH: 'x86'