From 41857a98c01d81eb376e89999c1059661421a2b9 Mon Sep 17 00:00:00 2001 From: sjfhsjfh Date: Mon, 3 Feb 2025 23:17:00 +0800 Subject: [PATCH] ci: add cargo test (#508) * ci: add cargo test * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: cache * ci: skip test_parse_chart --- .github/workflows/cargo_test.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/cargo_test.yml diff --git a/.github/workflows/cargo_test.yml b/.github/workflows/cargo_test.yml new file mode 100644 index 00000000..d374fff1 --- /dev/null +++ b/.github/workflows/cargo_test.yml @@ -0,0 +1,36 @@ +name: Cargo Test + +on: + push: {} + pull_request: {} + +jobs: + cargo-test: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Prepare + run: | + sudo apt-get update + sudo apt-get install librust-alsa-sys-dev libglib2.0-dev libasound2t64 libatk-adaptor libgail-common libgtk-3-dev + + - name: Setup Rust + run: | + curl https://sh.rustup.rs -sSf | sh -s -- -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + rustup toolchain install nightly-2023-02-01 + rustup default nightly-2023-02-01 + + - name: Cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: "true" + cache-all-crates: "true" + + - name: Run tests + run: | + cargo test -p phira --no-default-features -- --skip test_parse_chart