Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
more tries
Browse files Browse the repository at this point in the history
  • Loading branch information
thesuzerain committed Nov 14, 2023
1 parent 3620ce6 commit 0ab6450
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 24 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/coverage-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Rust33

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
SQLX_OFFLINE: "true"

jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- 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
31 changes: 31 additions & 0 deletions .github/workflows/coverage-tarp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: citarp

env:
CARGO_TERM_COLOR: always
SQLX_OFFLINE: true

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: citarp
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Generate code coverage
run: |
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
# token: ${{secrets.CODECOV_TOKEN}} # not required for public repos
fail_ci_if_error: true
35 changes: 11 additions & 24 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,19 @@ on:
branches: [master]

jobs:
custom-build-and-coverage:
run_rust_tests:
name: Run rust test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/[email protected]
with:
profile: minimal
toolchain: stable
override: true

- name: Build Entire Workspace
run: cargo build --workspace --all-features
env:
SQLX_OFFLINE: true
DATABASE_URL: postgresql://labrinth:labrinth@localhost/postgres

- name: Install llvm-tools and cargo-llvm-cov
run: rustup update stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: |
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
- name: Generate Coverage for Main Crate Only
run: cargo llvm-cov --package labrinth --all-features --codecov --output-path codecov.json
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
cat lcov.info
env:
SQLX_OFFLINE: true
DATABASE_URL: postgresql://labrinth:labrinth@localhost/postgres
SQLX_OFFLINE: true # needed to keep it from trying to connect to a database

0 comments on commit 0ab6450

Please sign in to comment.