-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (48 loc) · 1.27 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
mode:
- cgo
- wazero
os:
- macos-13
- macos-14
- ubuntu-22.04
- windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: '^1.21'
- name: run checks
run: go run mage check
env:
WASI_TEST_MODE: ${{ matrix.mode }}
# Runs tests using wazero inside a minimal golang docker image. This makes sure the code builds
# even when there is no C toolchain available. It is possible for code to work fine with CGO_ENABLED=0
# but not build without a C toolchain available, e.g. if C source files are checked into the repo
# without a build tag to exclude them from pure-Go builds.
docker-build:
runs-on: ubuntu-22.04
container:
image: golang:alpine
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: if command -v gcc &> /dev/null; then echo "GCC found but not expected"; exit 321; fi
- run: go run mage test