-
Notifications
You must be signed in to change notification settings - Fork 91
136 lines (129 loc) · 4.1 KB
/
main.yml
File metadata and controls
136 lines (129 loc) · 4.1 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * *' # run at 00:00 UTC
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ['1.18.x', '1.19.x']
steps:
- uses: actions/checkout@v2
# first download wasmtime's last static library build using python
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: python ci/download-wasmtime.py
# then run our go tests ...
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- run: go vet
- run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:build/linux-x86_64/
go test
name: Run go test
if: matrix.os == 'ubuntu-latest'
- run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:build/linux-x86_64/
go test -tags debug
name: Run go test -tags debug
if: matrix.os == 'ubuntu-latest'
- run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:build/linux-x86_64/
go test -tags debug
name: Run go test -tags debug
if: matrix.os == 'ubuntu-latest'
- run: go test
if: matrix.os != 'ubuntu-latest'
- run: go test -tags debug
if: matrix.os != 'ubuntu-latest'
- run: go test -tags debug
if: matrix.os != 'ubuntu-latest'
env:
GODEBUG: cgocheck=2
GOGC: 1
- name: Test bazel build on *nix
shell: bash
run: |
export GOOS=$(go env GOHOSTOS)
go get github.com/bazelbuild/bazelisk
export PATH=$PATH:$(go env GOPATH)/bin
bazelisk build --subcommands=pretty_print --verbose_failures :go_default_library
bazelisk test --subcommands=pretty_print --verbose_failures :go_default_test
if: matrix.os != 'windows-latest'
- name: Ready msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain
path-type: inherit
if: matrix.os == 'windows-latest'
- name: Test bazel build on Windows
shell: msys2 {0}
run: |
go get github.com/bazelbuild/bazelisk
bazelisk build --subcommands=pretty_print --verbose_failures --compiler=mingw-gcc :go_default_library
bazelisk test --subcommands=pretty_print --verbose_failures --compiler=mingw-gcc :go_default_test
if: matrix.os == 'windows-latest'
- name: Test vendoring on *nix
shell: bash
run: ./ci/test-vendoring.sh
if: matrix.os != 'windows-latest'
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: python ci/download-wasmtime.py
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:build/linux-x86_64/
go test -coverprofile cover.out ./...
- run: go tool cover -html=cover.out -o coverage.html
- uses: actions/upload-artifact@v1
with:
name: coverage
path: coverage.html
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
# https://stackoverflow.com/questions/42510140/check-format-for-continous-integration
- run: "diff -u <(echo -n) <(gofmt -d ./)"
upload_docs:
needs: [coverage]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: coverage
- run: find .
- name: Push to gh-pages
run: curl -LsSf https://git.io/fhJ8n | rustc - && (cd coverage && ../rust_out)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
GITHUB_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
BUILD_REPOSITORY_ID: ${{ github.repository }}
BUILD_SOURCEVERSION: ${{ github.sha }}