-
-
Notifications
You must be signed in to change notification settings - Fork 66
156 lines (139 loc) · 5.07 KB
/
Copy pathburrito-xcomp-check.yaml
File metadata and controls
156 lines (139 loc) · 5.07 KB
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
148
149
150
151
152
153
154
155
156
name: "Burrito Cross Build Build Tests"
on:
pull_request:
push:
branches: [main]
jobs:
build_examples:
name: build_examples_${{ matrix.host }}_${{ matrix.zig }}
runs-on: ${{ matrix.host }}
strategy:
fail-fast: false
matrix:
host: [ubuntu-latest, macos-latest, macos-14] # macos-14 is arm64
zig: ["0.15.2", "0.16.0"]
exclude:
# macos-14 (arm64) is only needed to verify cross-compile from
# Apple Silicon. Skip the old Zig version there to save CI time.
- host: macos-14
zig: "0.15.2"
steps:
# Deps
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
if: matrix.host == 'ubuntu-latest'
with:
otp-version: "27.3"
elixir-version: "1.18.3"
- uses: erlef/setup-beam@v1
if: matrix.host == 'macos-latest' || matrix.host == 'macos-14'
with:
otp-version: "27.3"
elixir-version: "1.18.3"
- uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ matrix.zig }}
- name: Set up Homebrew
if: matrix.host == 'macos-latest' || matrix.host == 'macos-14'
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: sudo apt-get -y install xz-utils
if: matrix.host == 'ubuntu-latest'
- run: brew install elixir xz
if: matrix.host == 'macos-latest' || matrix.host == 'macos-14'
# Restore Cache
- uses: actions/cache/restore@v3
if: matrix.host == 'ubuntu-latest'
id: cache-restore-linux
with:
path: /home/runner/.cache/burrito_file_cache/
key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }}
- uses: actions/cache/restore@v3
if: matrix.host == 'macos-latest'
id: cache-restore-macos-intel
with:
path: /Users/runner/Library/Caches/burrito_file_cache/
key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }}
- uses: actions/cache/restore@v3
if: matrix.host == 'macos-14'
id: cache-restore-macos-arm
with:
path: /Users/runner/Library/Caches/burrito_file_cache/
key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }}
# Build Example CLI App
- name: cli_example
working-directory: "./examples/cli_example"
run: "mix deps.get && mix release"
# Save Cache (Linux)
- uses: actions/cache/save@v3
if: matrix.host == 'ubuntu-latest'
id: cache-save-linux
with:
path: /home/runner/.cache/burrito_file_cache/
key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }}
# Save Cache (macOS)
- uses: actions/cache/save@v3
if: matrix.host == 'macos-latest'
id: cache-save-macos-intel
with:
path: /Users/runner/Library/Caches/burrito_file_cache/
key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }}
- uses: actions/cache/save@v3
if: matrix.host == 'macos-14'
id: cache-save-macos-arm
with:
path: /Users/runner/Library/Caches/burrito_file_cache/
key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }}
# Upload Wrapped Binaries
- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: burrito_${{ matrix.host }}_${{ matrix.zig }}_host_bins
path: ./examples/**/burrito_out/*
retention-days: 1
#### Run example binaries ####
# Windows binaries: built on Linux/macOS hosts, run on windows-latest
run_examples_windows:
needs: build_examples
strategy:
fail-fast: false
matrix:
host: [ubuntu-latest, macos-latest]
zig: ["0.15.2", "0.16.0"]
runs-on: windows-latest
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: burrito_${{ matrix.host }}_${{ matrix.zig }}_host_bins
- run: cli_example/burrito_out/example_cli_app_windows.exe
run_examples_linux:
needs: build_examples
strategy:
fail-fast: false
matrix:
host: [ubuntu-latest, macos-latest, macos-14]
zig: ["0.15.2", "0.16.0"]
runs-on: ubuntu-latest
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: burrito_${{ matrix.host }}_${{ matrix.zig }}_host_bins
- run: chmod +x cli_example/burrito_out/example_cli_app_linux
- run: cli_example/burrito_out/example_cli_app_linux
run_examples_macos:
needs: build_examples
strategy:
fail-fast: false
matrix:
host: [ubuntu-latest, macos-latest, macos-14]
zig: ["0.15.2", "0.16.0"]
runs-on: ${{ matrix.host == 'macos-14' && 'macos-14' || 'macos-latest' }}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: burrito_${{ matrix.host }}_${{ matrix.zig }}_host_bins
- run: chmod +x cli_example/burrito_out/example_cli_app_macos
- run: cli_example/burrito_out/example_cli_app_macos