From 5d340a8da338c7085c33c2d884eb8e171b5f4546 Mon Sep 17 00:00:00 2001 From: Philipp Caspers <117186241+philipp-caspers@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:31:57 +0000 Subject: [PATCH] ci: Separate unit and integration tests also run the unit test in sequence for now because they share the same test resources e.g ports or ros topics. --- .github/workflows/ci.yml | 7 +++++-- .github/workflows/ci_integration_test.yml | 21 +++++++++++++++++++ .../{ci_test.yml => ci_unit_test.yml} | 6 +++--- 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci_integration_test.yml rename .github/workflows/{ci_test.yml => ci_unit_test.yml} (84%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d8c19c..5ec44dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,12 @@ jobs: build: needs: build_dev_container uses: ./.github/workflows/ci_build.yml - test: + unit_test: needs: build_dev_container - uses: ./.github/workflows/ci_test.yml + uses: ./.github/workflows/ci_unit_test.yml + integration_test: + needs: build_dev_container + uses: ./.github/workflows/ci_integration_test.yml lint: needs: build_dev_container uses: ./.github/workflows/ci_lint.yml diff --git a/.github/workflows/ci_integration_test.yml b/.github/workflows/ci_integration_test.yml new file mode 100644 index 0000000..970c048 --- /dev/null +++ b/.github/workflows/ci_integration_test.yml @@ -0,0 +1,21 @@ +name: CI Integration Test +'on': + workflow_call: null +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout (GitHub) + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Cargo integration tests + uses: devcontainers/ci@v0.3 + with: + cacheFrom: ghcr.io/vorausrobotik/voraus-ros-bridge-dev + runCmd: cargo test --test '*' --verbose -- --test-threads=1 + push: never diff --git a/.github/workflows/ci_test.yml b/.github/workflows/ci_unit_test.yml similarity index 84% rename from .github/workflows/ci_test.yml rename to .github/workflows/ci_unit_test.yml index 384221e..d989814 100644 --- a/.github/workflows/ci_test.yml +++ b/.github/workflows/ci_unit_test.yml @@ -1,4 +1,4 @@ -name: CI Test +name: CI Unit Test 'on': workflow_call: null jobs: @@ -13,9 +13,9 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Cargo test + - name: Cargo unit tests uses: devcontainers/ci@v0.3 with: cacheFrom: ghcr.io/vorausrobotik/voraus-ros-bridge-dev - runCmd: cargo test --verbose + runCmd: cargo test --bins --verbose push: never