This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3620ce6
commit 0ab6450
Showing
3 changed files
with
80 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|