From 03bb53a7a7ba0cd479aa4dca783f99b8df65bce3 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Thu, 7 Dec 2023 18:18:45 +0900 Subject: [PATCH] ci: split build and test --- .../{build_and_test.yml => build.yml} | 11 +----- ...platform-compilation.yaml => release.yaml} | 0 .github/workflows/test.yml | 36 +++++++++++++++++++ 3 files changed, 37 insertions(+), 10 deletions(-) rename .github/workflows/{build_and_test.yml => build.yml} (68%) rename .github/workflows/{cross-platform-compilation.yaml => release.yaml} (100%) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build.yml similarity index 68% rename from .github/workflows/build_and_test.yml rename to .github/workflows/build.yml index 496ddf8c6..739cb71bb 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Rustup - run: rustup update stable + run: rustup toolchain install stable --profile minimal - name: Rust Cache uses: Swatinem/rust-cache@v2 - name: Install cargo-llvm-cov @@ -34,12 +34,3 @@ jobs: run: mkdir -p app/build - name: Build run: cargo build --verbose --workspace - - name: Test - run: cargo llvm-cov --workspace --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 diff --git a/.github/workflows/cross-platform-compilation.yaml b/.github/workflows/release.yaml similarity index 100% rename from .github/workflows/cross-platform-compilation.yaml rename to .github/workflows/release.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..1db7c6403 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: Test + +on: + push: + branches: + - main + tags: + - "*" + pull_request: + +env: + CARGO_TERM_COLOR: always + +permissions: + contents: read + +jobs: + bulid_and_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 cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Test + run: cargo llvm-cov --workspace --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