diff --git a/.github/workflows/coverage-2.yml b/.github/workflows/coverage-2.yml deleted file mode 100644 index 82f2a194..00000000 --- a/.github/workflows/coverage-2.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Rust33 - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - CARGO_TERM_COLOR: always - SQLX_OFFLINE: "true" - -jobs: - integration-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # Start Docker Compose - - name: Start Docker Compose - run: docker-compose up -d - - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2 - - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - - name: Start containers - run: docker compose up -d - # - name: Install self signed certificate - # run: | - # until [ -f ./resources/test/certs/cert.pem ]; do sleep 1; done - # sudo cp ./resources/test/certs/cert.pem /usr/local/share/ca-certificates/localhost.crt && sudo update-ca-certificates - # timeout-minutes: 1 - - name: Run integration tests - run: cargo llvm-cov test --verbose --test '*' --lcov --output-path lcov.integration-tests.info - env: - RUSTFLAGS: "-C instrument-coverage" - SQLX_OFFLINE: "true" - - - name: Stop containers - if: always() - run: docker compose down diff --git a/.github/workflows/coverage-tarp.yml b/.github/workflows/coverage-tarp.yml index f56ed99e..b4ec5429 100644 --- a/.github/workflows/coverage-tarp.yml +++ b/.github/workflows/coverage-tarp.yml @@ -11,12 +11,14 @@ on: branches: [ master ] jobs: citarp: - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 # Start Docker Compose - name: Start Docker Compose run: docker-compose up -d + - name: Install cargo tarpaulin + uses: taiki-e/install-action@cargo-tarpaulin - name: Generate code coverage run: | cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index ff73f485..00000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Custom Build and Coverage - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - run_rust_tests: - name: Run rust test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # Start Docker Compose - - name: Start Docker Compose - run: docker-compose up -d - - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: Generate code coverage - run: | - cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - cat lcov.info - env: - SQLX_OFFLINE: true # needed to keep it from trying to connect to a database - diff --git a/.github/workflows/coverage2.yml b/.github/workflows/coverage2.yml index a9646d0e..a01d713b 100644 --- a/.github/workflows/coverage2.yml +++ b/.github/workflows/coverage2.yml @@ -17,25 +17,24 @@ jobs: - name: Install Rust run: rustup update stable # Cache dependencies and build artifacts - - name: Cache build artifacts and dependencies - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/cache-cargo-install-action@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + tool: sqlx-cli - uses: actions-rs/cargo@v1 with: command: build env: + SQLX_VERSION: 0.6.0 SQLX_OFFLINE: true - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: Generate code coverage run: cargo llvm-cov --no-clean --all-features --frozen --lcov --output-path lcov.info env: - SQLX_OFFLINE: true # needed to keep it from trying to connect to a database + SQLX_VERSION: 0.6.0 + SQLX_OFFLINE: true + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: