From 71c6a25747de34a3b42ee55d08ca074428acf30e Mon Sep 17 00:00:00 2001 From: akagiyuu Date: Sun, 8 Jun 2025 11:24:17 +0700 Subject: [PATCH 1/3] feat(ci): add nextest --- .github/workflows/check.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index a1a9c40..e46d353 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -39,18 +39,27 @@ jobs: target: x86_64-unknown-linux-gnu toolchain: nightly steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Install toolchain uses: dtolnay/rust-toolchain@master with: target: ${{ matrix.target }} toolchain: ${{ matrix.toolchain }} - - run: ${{ matrix.deps }} - - uses: Swatinem/rust-cache@v2 + components: llvm-tools-preview + + - name: Init rust cache + uses: Swatinem/rust-cache@v2 + + - name: Install cargo nextest + uses: taiki-e/install-action@nextest + - name: Install dependencies uses: awalsh128/cache-apt-pkgs-action@latest with: packages: openjdk-8-jdk build-essential python3 python-is-python3 libseccomp-dev libgbm-dev libxkbcommon-x11-0 pkg-config rustc + - name: Run test run: | - cargo test --target ${{ matrix.target }} + cargo nextest run --target ${{ matrix.target }} From 40ce9d1075ce4848938489072d5b0906052d9a19 Mon Sep 17 00:00:00 2001 From: akagiyuu Date: Sun, 8 Jun 2025 11:27:45 +0700 Subject: [PATCH 2/3] refactor(ci): split check and test --- .github/workflows/check.yaml | 40 ----------------------------- .github/workflows/test.yaml | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index e46d353..7e96909 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -23,43 +23,3 @@ jobs: run: cargo clippy --workspace -- -D warnings - name: Check rustfmt run: cargo fmt --all -- --check - - test: - name: Run unit test and integration test - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - toolchain: stable - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - toolchain: nightly - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install toolchain - uses: dtolnay/rust-toolchain@master - with: - target: ${{ matrix.target }} - toolchain: ${{ matrix.toolchain }} - components: llvm-tools-preview - - - name: Init rust cache - uses: Swatinem/rust-cache@v2 - - - name: Install cargo nextest - uses: taiki-e/install-action@nextest - - - name: Install dependencies - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: openjdk-8-jdk build-essential python3 python-is-python3 libseccomp-dev libgbm-dev libxkbcommon-x11-0 pkg-config rustc - - - name: Run test - run: | - cargo nextest run --target ${{ matrix.target }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..948dfd7 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,50 @@ +on: + workflow_dispatch: + push: + branches: main + pull_request: + branches: main + +permissions: + contents: read + +jobs: + test: + name: Run test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + toolchain: stable + + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + toolchain: nightly + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@master + with: + target: ${{ matrix.target }} + toolchain: ${{ matrix.toolchain }} + components: llvm-tools-preview + + - name: Init rust cache + uses: Swatinem/rust-cache@v2 + + - name: Install cargo nextest + uses: taiki-e/install-action@nextest + + - name: Install dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: openjdk-8-jdk build-essential python3 python-is-python3 libseccomp-dev libgbm-dev libxkbcommon-x11-0 pkg-config rustc + + - name: Run test + run: | + cargo nextest run --target ${{ matrix.target }} From 0ab434ab6e2378f3b15d131f10893e578ebdd9e1 Mon Sep 17 00:00:00 2001 From: akagiyuu Date: Sun, 8 Jun 2025 11:33:12 +0700 Subject: [PATCH 3/3] feat(ci): add code coverage --- .github/workflows/test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 948dfd7..0b8895e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,6 +40,9 @@ jobs: - name: Install cargo nextest uses: taiki-e/install-action@nextest + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Install dependencies uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -47,4 +50,4 @@ jobs: - name: Run test run: | - cargo nextest run --target ${{ matrix.target }} + cargo llvm-cov nextest --target ${{ matrix.target }}