Migrate air workflow to github-actions (#281)

This commit is contained in:
Anatoly Laskaris 2022-07-01 16:48:39 +03:00 committed by GitHub
parent 4acfb19e08
commit 4201ecce6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 49 deletions

View File

@ -1,49 +0,0 @@
version: 2
jobs:
air:
docker:
- image: circleci/rust:latest
resource_class: medium+
environment:
RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1
steps:
- checkout
- restore_cache:
keys:
- air01-{{ checksum "Cargo.lock" }}
- run: |
rustup toolchain install nightly-2022-03-20-x86_64-unknown-linux-gnu
rustup default nightly-2022-03-20-x86_64-unknown-linux-gnu
rustup target add wasm32-wasi
rustup component add rustfmt
rustup component add clippy
cargo install --force marine
# build a Wasm binary for interpreter
(cd air-interpreter; marine build --features marine)
# build Wasm binaries for tests
(cd air/tests/test_module; ./build_test_binaries.sh)
cargo fmt --all -- --check --color always
cargo check
cargo test --release
# The memory sanitizer on cargo test has false positive even on empty project.
for san in address leak; do
RUSTFLAGS="-Z sanitizer=$san" cargo test --features test_with_native_code --target x86_64-unknown-linux-gnu
done
cargo clippy -v
- save_cache:
paths:
- ~/.cargo
- ~/.rustup
key: air01-{{ checksum "Cargo.lock" }}
workflows:
version: 2
air:
jobs:
- air

14
.github/download_marine.sh vendored Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -o pipefail -o errexit -o nounset
set -x
MARINE_RELEASE="https://api.github.com/repos/fluencelabs/marine/releases/latest"
OUT_DIR=/usr/local/bin
# get metadata about release
curl -s -H "Accept: application/vnd.github.v3+json" $MARINE_RELEASE |
# extract url and name for asset with name "marine"
# also append $OUT_DIR to each name so file is saved to $OUT_DIR
jq -r ".assets | .[] | select(.name == \"marine\") | \"\(.browser_download_url) $OUT_DIR/\(.name)\"" |
# download assets
xargs -n2 bash -c 'curl -L $0 -o $1 && chmod +x $1'

58
.github/workflows/aquavm.yml vendored Normal file
View File

@ -0,0 +1,58 @@
name: "aquavm"
on:
pull_request:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
air:
name: "Run aquavm tests"
runs-on: builder
env:
RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-29
target: wasm32-wasi
components: rustfmt, clippy
- name: "Cache rust"
uses: Swatinem/rust-cache@v1
- name: "Download marine"
run: .github/download_marine.sh
- name: "Build Wasm binary for interpreter"
run: marine build --features marine
working-directory: air-interpreter
- name: "Build Wasm binary for tests"
run: ./build_test_binaries.sh
working-directory: air/tests/test_module
- name: "cargo fmt"
run: cargo fmt --all -- --check
- name: "cargo check"
run: cargo check
- name: "cargo test"
run: |
cargo test --release
# The memory sanitizer on cargo test has false positive even on empty project.
for san in address leak; do
RUSTFLAGS="-Z sanitizer=$san" cargo test --features test_with_native_code --target x86_64-unknown-linux-gnu
done
- name: "cargo clippy"
run: cargo clippy -v