Skip to content

CI

CI #56

Workflow file for this run

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.16.x', '1.17.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: go test
- run: go test -tags debug
- run: go test -tags debug
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.17'
- run: 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.17'
# 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 }}