-
Notifications
You must be signed in to change notification settings - Fork 66
147 lines (143 loc) · 4.25 KB
/
test.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Test
on:
push:
branches:
- master
pull_request:
env:
DOCKER_FLAGS: ""
CI: 1
jobs:
output:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: diff output
run: rake docker_test_output
build-docker:
runs-on: ubuntu-latest
strategy:
matrix:
compiler:
- gcc
- clang
outputs:
docker_image_sha: ${{ steps.build.outputs.sha }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: build
uses: docker/build-push-action@v5
with:
build-args: |
IMAGE=ruby:3.3
NAT_CXX_FLAGS=-DNAT_GC_GUARD
NAT_BUILD_MODE=debug
CC=${{ matrix.compiler == 'clang' && 'clang' || 'gcc' }}
CXX=${{ matrix.compiler == 'clang' && 'clang++' || 'g++' }}
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/natalie-${{ matrix.compiler }}:${{ github.run_id }}
outputs: type=image,push=true,sha=true
linux:
needs: build-docker
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler:
- gcc
- clang
group:
- group1
- group2
- group3
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Docker image
run: docker pull ghcr.io/${{ github.repository_owner }}/natalie-${{ matrix.compiler }}:${{ github.run_id }}
- name: Run tests
run: |
export GLOB=$(ruby spec/support/split_specs.rb 3 ${{ matrix.group }})
docker run --entrypoint rake ghcr.io/${{ github.repository_owner }}/natalie-${{ matrix.compiler }}:${{ github.run_id }} test
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
group:
- group1
- group2
- group3
- group4
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: install ruby
run: |
brew update
brew uninstall -f --ignore-dependencies ruby
brew uninstall -f --ignore-dependencies [email protected]
rm -rf /usr/local/lib/ruby/gems/3.0.0 /usr/local/opt/[email protected]
brew install [email protected]
- name: check ruby
run: |
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
which ruby
ruby --version
which bundle
- name: install build tools
run: brew install --force --overwrite autoconf automake libtool pkg-config
- name: install openssl
run: brew install openssl
- name: install libffi
run: brew install libffi
# - name: setup upterm session for remote debugging
# uses: owenthereal/action-upterm@v1
- name: test with clang on macOS
env:
PKG_CONFIG_PATH: /usr/local/opt/openssl@3/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/opt/homebrew/opt/libffi/lib/pkgconfig
NAT_BUILD_MODE: release
run: |
export GLOB=$(ruby spec/support/split_specs.rb 4 ${{ matrix.group }})
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
rake test
self-hosted:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: build self-hosted binary
run: rake docker_test_self_hosted
asan:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: test with AddressSanitizer
run: rake docker_test_asan