-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (76 loc) · 2.04 KB
/
ci.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
71
72
73
74
75
76
77
78
79
80
81
name: CI
on:
workflow_dispatch:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Run rubocop
run: bundle exec rubocop
build:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
os-arch: [linux-amd64, darwin-arm64, windows-amd64]
include:
- os-arch: windows-amd64
suffix: .exe
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: build
run: rake build:${{ matrix.os-arch }}
- name: Upload test binary (${{ matrix.os-arch }}
uses: actions/upload-artifact@v4
with:
name: rf-${{ github.sha }}-${{ matrix.os-arch }}
path: build/${{ matrix.os-arch }}/bin/rf${{ matrix.suffix }}
test:
needs: build
strategy:
matrix:
runs-on: [ubuntu-latest, macos-14, windows-latest]
include:
- runs-on: ubuntu-latest
os-arch: linux-amd64
- runs-on: macos-14
os-arch: darwin-arm64
- runs-on: windows-latest
os-arch: windows-amd64
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: rf-${{ github.sha }}-${{ matrix.os-arch }}
path: build/bin
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Grant execute permission
if: ${{ ! contains(matrix.runs-on, 'windows') }}
run: chmod +x build/bin/rf
- name: Run test
run: bundle exec rake spec