From 8dc04882928d2cfee1c2576226d05df7e6b1e643 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Thu, 7 Dec 2023 23:31:21 +0900 Subject: [PATCH] split workflows --- .github/workflows/build.yml | 4 +- .github/workflows/release.yaml | 2 +- .github/workflows/{test.yml => test_app.yml} | 8 ++-- .github/workflows/test_libs.yml | 43 ++++++++++++++++++++ 4 files changed, 51 insertions(+), 6 deletions(-) rename .github/workflows/{test.yml => test_app.yml} (85%) create mode 100644 .github/workflows/test_libs.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 818a25c59..bd4c74b1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build +name: Build Tauri App on: push: @@ -31,4 +31,4 @@ jobs: - name: Make Tauri build destination run: mkdir -p app/build - name: Build - run: cargo build --verbose --workspace + run: cargo build --verbose --package app diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index de8251592..6d5df5b4a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-latest, windows-latest] + platform: [macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test_app.yml similarity index 85% rename from .github/workflows/test.yml rename to .github/workflows/test_app.yml index 882697d83..63dc0f33f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test_app.yml @@ -1,4 +1,4 @@ -name: Test +name: Test Tauri App on: push: @@ -7,6 +7,8 @@ on: tags: - "*" pull_request: + paths: + - "app/**" env: CARGO_TERM_COLOR: always @@ -23,7 +25,7 @@ jobs: run: rustup toolchain install stable --profile minimal - name: Rust Cache uses: Swatinem/rust-cache@v2 - - name: install dependencies + - name: Install dependencies # if: matrix.platform == 'ubuntu-20.04' run: | sudo apt-get update @@ -33,7 +35,7 @@ jobs: - name: Make Tauri build destination run: mkdir -p app/build - name: Test - run: cargo llvm-cov --workspace --lcov --output-path lcov.info --all-features + run: cargo llvm-cov --package app --lcov --output-path lcov.info --all-features - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: diff --git a/.github/workflows/test_libs.yml b/.github/workflows/test_libs.yml new file mode 100644 index 000000000..8d0da648a --- /dev/null +++ b/.github/workflows/test_libs.yml @@ -0,0 +1,43 @@ +name: Test Libraries + +on: + push: + branches: + - main + tags: + - "*" + pull_request: + paths: + - "nusamai/**" + - "nusamai-*/**" + +env: + CARGO_TERM_COLOR: always + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Rustup + run: rustup toolchain install stable --profile minimal + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt install -y libwebkit2gtk-4.0-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Test + run: cargo llvm-cov --workspace --exclude app --lcov --output-path lcov.info --all-features + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: lcov.info + fail_ci_if_error: false