Repository navigation
65 lines (60 loc) · 1.98 KB
/
Copy pathci.yml
File metadata and controls
65 lines (60 loc) · 1.98 KB
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
59
60
61
62
63
64
65
name: CI
on:
push:
pull_request:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
CARGO_TARGET_DIR: target
PD_BUILD_GIT_TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'untagged' }}
PD_BUILD_GIT_COMMIT: ${{ github.sha }}
PD_BUILD_GIT_DIRTY: "false"
jobs:
rust:
name: Rust lint and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Tests
run: cargo test --workspace -- --test-threads=1
- name: CLI smoke
run: |
cargo run --bin pd-vm-compat-run -- examples/example.js
cargo run --bin pd-vm-compat-run -- examples/example.lua
cargo run --bin pd-vm-compat-run -- --version
binaries:
name: pd-vm-compat-run (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build pd-vm-compat-run
run: cargo build --bin pd-vm-compat-run --release
- name: Stage pd-vm-compat-run artifact
shell: bash
run: |
mkdir -p dist
suffix=""
if [[ "${{ runner.os }}" == "Windows" ]]; then suffix=".exe"; fi
cp "target/release/pd-vm-compat-run${suffix}" "dist/pd-vm-compat-run-${{ runner.os }}-${{ runner.arch }}${suffix}"
- uses: actions/upload-artifact@v4
with:
name: pd-vm-compat-run-${{ runner.os }}-${{ runner.arch }}
path: dist/*
- name: Upload pd-vm-compat-run release asset
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: dist/*