diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 107913eb63..1178caf08c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -16,6 +16,10 @@ on: - "**.yml" - "**.yaml" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: COLUMNS: 150 ZO_RESULT_CACHE_ENABLED: true @@ -38,13 +42,6 @@ jobs: - 5432:5432 # needed because the postgres container does not provide a healthcheck options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - mysql: - image: mysql:9.3 - env: - MYSQL_ROOT_PASSWORD: password - MYSQL_DATABASE: mysql - ports: - - 3306:3306 steps: - name: Clone the current repo @@ -93,7 +90,7 @@ jobs: if: steps.check_changes.outputs.has_changes == 'true' run: cargo fmt --all -- --check - - name: Setup cargo config + - name: Run clippy if: steps.check_changes.outputs.has_changes == 'true' run: cargo --config net.git-fetch-with-cli=true clippy -- -D warnings @@ -111,9 +108,7 @@ jobs: ./coverage.sh run-cov # cleanup - rm -rf data - rm -rf ./json - rm -rf ./src/infra/data + rm -rf data ./json ./src/infra/data # Run with sqlite echo "Running with sqlite" @@ -121,18 +116,7 @@ jobs: export ZO_META_POSTGRES_DSN="" ./coverage.sh run-cov - # cleanup - rm -rf data - rm -rf ./json - rm -rf ./src/infra/data - - # setup and run with mysql - echo "Running with mysql" - export ZO_META_STORE=mysql - export ZO_META_MYSQL_DSN=mysql://root:password@localhost:3306/mysql - ./coverage.sh run-cov - - # finally print the coverage data + # finally check the coverage data ./coverage.sh check ui_unit_tests: diff --git a/coverage.sh b/coverage.sh index 8007340104..b51dcaa194 100755 --- a/coverage.sh +++ b/coverage.sh @@ -30,6 +30,8 @@ _cov_test() { cargo llvm-cov nextest \ --workspace \ --verbose \ + --no-cfg-coverage \ + --no-cfg-coverage-nightly \ --ignore-filename-regex 'job|.*generated.*' \ --test-threads=1 \ --no-fail-fast \