Skip to content

fix: fix bot login name #310

fix: fix bot login name

fix: fix bot login name #310

name: Builds and Tests
on: [pull_request]
jobs:
libwasmvm_sanity:
runs-on: ubuntu-latest
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
target: wasm32-unknown-unknown
profile: minimal
override: true
- name: Checkout
uses: actions/checkout@v2
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo
key: cargocache-v2-libwasmvm_sanity-rust:1.60.0-${{ hashFiles('Cargo.lock') }}
- name: Install shellcheck
run: sudo apt install shellcheck
- name: Show version information
run: rustc --version; cargo --version; rustup --version
- name: Add Rust components
run: rustup component add clippy rustfmt
- name: Check formatting
working-directory: ./libwasmvm
run: cargo fmt -- --check
- name: Run linter
working-directory: ./libwasmvm
run: cargo clippy -- -D warnings
- name: Run unit tests
working-directory: ./libwasmvm
run: cargo test
- name: Build docs
working-directory: ./libwasmvm
run: cargo doc --no-deps
- name: Test docs
working-directory: ./libwasmvm
run: |
sed -i '/^crate-type = \["cdylib"\]/d' Cargo.toml
cargo test --doc
- name: Run shellcheck
run: ./devtools/check_shellscript_lint.sh
format-go:
runs-on: ubuntu-latest
steps:
- name: set up
uses: actions/setup-go@v2
with:
go-version: '1.20'
id: go
- name: Checkout
uses: actions/checkout@v2
- name: Check Go formatting
run: |
[ "$(gofmt -l .)" = "" ] || (gofmt -d . && exit 1)
tidy-go:
runs-on: ubuntu-latest
steps:
- name: set up
uses: actions/setup-go@v2
with:
go-version: '1.20'
id: go
- name: CHeckout
uses: actions/checkout@v2
- name: Check go mod tidy
# Use --check or --exit-code when available (Go 1.19?)
# https://github.com/golang/go/issues/27005
run: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
format-scripts:
runs-on: ubuntu-latest
steps:
- name: set up
uses: actions/setup-go@v2
with:
go-version: '1.20'
id: go
- name: Install shfmt
run: GO111MODULE=on go install mvdan.cc/sh/v3/cmd/shfmt@v3.4.0
- name: Run shfmt
run: shfmt -d .
lint-scripts:
runs-on: ubuntu-20.04
steps:
- name: Install packages
run: |
sudo apt update
sudo apt install -y git shellcheck
- name: Checkout
uses: actions/checkout@v2
- name: Run shellcheck
run: ./devtools/check_shellscript_lint.sh
test_internal_shared_lib:
runs-on: ubuntu-latest
env:
GORACE: "halt_on_error=1"
BUILD_VERSION: $(echo $GITHUB_SHA | cut -c 1-10)
steps:
- name: set up
uses: actions/setup-go@v2
with:
go-version: '1.20'
id: go
- name: Checkout
uses: actions/checkout@v2
- name: Go integration tests
run: make test
- name: Go tests with cgo and race condition safety checks
run: make test-safety
- name: Make build-go
run: make build-go
build_shared_library:
runs-on: ubuntu-latest
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
target: x86_64-unknown-linux-gnu
profile: minimal
override: true
- name: Checkout
uses: actions/checkout@v2
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo
key: cargocache-v2-build_shared_library-rust:1.60.0-${{ hashFiles('Cargo.lock') }}
- name: Show version information
run: rustc --version; cargo --version; rustup --version
- name: Create release build of libwasmvm
run: make build-rust
- name: Upload libwasmvm
uses: actions/upload-artifact@v2
with:
name: libwasmvm
path: ./internal/api/libwasmvm.x86_64.so
test_shared_lib:
needs: build_shared_library
runs-on: ubuntu-latest
env:
GORACE: "halt_on_error=1"
BUILD_VERSION: $(echo $GITHUB_SHA | cut -c 1-10)
steps:
- name: set up
uses: actions/setup-go@v2
with:
go-version: '1.20'
id: go
- name: Checkout
uses: actions/checkout@v2
- name: Download libwasmvm
uses: actions/download-artifact@v2
with:
name: libwasmvm
path: /tmp/builds
- name: Copy libwasmvm
run: cp /tmp/builds/libwasmvm.x86_64.so ./internal/api
- name: Go integration tests
run: make test
- name: Go tests with cgo and race condition safety checks
run: make test-safety
- name: Make build-go
run: make build-go
test_static_lib:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare docker image
run: cd builders && make docker-image-alpine
- name: Build static library and test
run: make test-alpine