e0f4cf2c4b
CI / checks (push) Successful in 1m17s
Co-authored-by: Danny Kim <temeddix@gmail.com> Co-committed-by: Danny Kim <temeddix@gmail.com>
52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
checks:
|
|
runs-on: self-hosted
|
|
container:
|
|
volumes:
|
|
- memona-plugin-target:/cargo-target
|
|
env:
|
|
CARGO_BUILD_JOBS: 2
|
|
CARGO_TARGET_DIR: /cargo-target/serialized
|
|
CARGO_HOME: /cargo-target/cargo-home
|
|
RUSTUP_HOME: /cargo-target/rustup-home
|
|
RUSTUP_TOOLCHAIN: stable
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install system packages
|
|
run: >-
|
|
apt-get update && apt-get install -y --no-install-recommends
|
|
build-essential ca-certificates curl util-linux
|
|
|
|
# The same lock protects the shared toolchain and every Cargo command.
|
|
# Keep its target and lock paths in sync with Memona's plugin checks.
|
|
- name: Check and build plugin
|
|
run: |
|
|
flock --no-fork "$CARGO_TARGET_DIR.lock" sh -ec '
|
|
export PATH="$CARGO_HOME/bin:$PATH"
|
|
if [ ! -x "$CARGO_HOME/bin/rustup" ]; then
|
|
mkdir -p "$CARGO_HOME"
|
|
curl --proto =https --tlsv1.2 -fsSL https://sh.rustup.rs -o "$CARGO_HOME/rustup-init.sh"
|
|
sh "$CARGO_HOME/rustup-init.sh" -y --no-modify-path --default-toolchain none
|
|
rm "$CARGO_HOME/rustup-init.sh"
|
|
fi
|
|
rustup toolchain install stable --profile minimal --component clippy,rustfmt --target wasm32-wasip2 --no-self-update
|
|
cargo fmt --check
|
|
cargo clippy --locked --all-targets -- -D warnings
|
|
cargo test --locked --lib
|
|
cargo build --locked --release --target wasm32-wasip2
|
|
'
|