generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 22
58 lines (50 loc) · 2.35 KB
/
testdata.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
55
56
57
58
# `name` value will appear "as is" in the badge.
# See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
# yamllint --format github .github/workflows/testdata.yaml
---
name: "testdata"
on:
push: # We run tests on non-tagged pushes to main
tags: ''
branches: main
paths-ignore:
- '**/*.md'
pull_request: # We also run tests on pull requests targeted at the main branch.
branches: main
paths-ignore:
- '**/*.md'
# workflow_dispatch will let us manually trigger the workflow from GitHub actions dashboard.
# For example, you can try to build a branch without raising a pull request.
# See https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
jobs:
# Note: TinyGo is not idempotent when generating wasm, so we neither check in
# %.wasm, nor do we verify it matches what's checked in.
testdata:
runs-on: ubuntu-22.04
strategy:
matrix:
go-version: # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
- "1.23"
tinygo-version: # Note: TinyGo only supports latest: https://github.com/tinygo-org/tinygo/releases
- "0.34.0" # Latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: "Set up TinyGo"
run: | # Installing via curl so commands are similar on OS/x
tinygo_version=${{ matrix.tinygo-version }}
curl -sSL https://github.com/tinygo-org/tinygo/releases/download/v${tinygo_version}/tinygo${tinygo_version}.linux-amd64.tar.gz | sudo tar -C /usr/local -xzf -
echo "TINYGOROOT=/usr/local/tinygo" >> $GITHUB_ENV
echo "/usr/local/tinygo/bin" >> $GITHUB_PATH
- name: "Set up wat2wasm"
run: | # Needed for testdata. wabt includes wat2wasm.
wabt_version=1.0.35
wabt_url=https://github.com/WebAssembly/wabt/releases/download/${wabt_version}/wabt-${wabt_version}-ubuntu-20.04.tar.gz
curl -sSL ${wabt_url} | tar --strip-components 2 -C /usr/local/bin -xzf - wabt-${wabt_version}/bin/wat2wasm
- name: "generate testdata"
run: make testdata
- name: Check diff
run: git diff --exit-code -- .