random change #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
pull_request: | |
branches: | |
- "**" | |
workflow_call: | |
jobs: | |
build: | |
name: test | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: [stable] | |
profile: [dev, release] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: deps | |
run: | | |
sudo apt install -y build-essential autoconf clang-14 flex bison pkg-config autopoint | |
sudo ln -s /usr/include/asm-generic /usr/include/asm | |
sudo rm -f /bin/clang | |
sudo ln -s /usr/bin/clang-14 /bin/clang | |
- name: cargo test | |
run: cargo test --profile=${{ matrix.profile }} --locked | |
- name: cargo build | |
run: cargo build --bins --examples --profile=${{ matrix.profile }} --locked | |
- name: e2e test (runs with sudo) | |
run: | | |
if [ "${{ matrix.profile }}" = "dev" ]; then | |
sudo ./target/debug/e2e ./target/debug/past ./target/debug/examples | |
elif [ "${{ matrix.profile }}" = "release" ]; then | |
sudo ./target/release/e2e ./target/release/past ./target/release/examples | |
else | |
echo "Error: Profile '${{ matrix.profile }}' is not expected." | |
exit 1 | |
fi | |
clippy: | |
name: lint with clippy | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: deps | |
run: | | |
sudo apt install -y build-essential autoconf clang-14 flex bison pkg-config autopoint | |
sudo ln -s /usr/include/asm-generic /usr/include/asm | |
sudo rm -f /bin/clang | |
sudo ln -s /usr/bin/clang-14 /bin/clang | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --locked --no-deps --all-targets --tests -- -D warnings | |
rustfmt: | |
name: lint formatting | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo fmt -- --check |