-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: fix integration tests after refactor * chore: fix clippy warnings * test: move repository tests to integration test folder * test: move service tests to integration test folder * ci: add test workflow * fix: run integration tests only on linux * ci: run unit tests on test matrix
- Loading branch information
Showing
21 changed files
with
1,009 additions
and
1,603 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
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,119 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install minimal stable with clippy and rustfmt | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: default | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Format | ||
run: cargo fmt -- --check | ||
|
||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-11 | ||
- windows-latest | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install minimal stable with clippy and rustfmt | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: default | ||
toolchain: stable | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: build and lint with clippy | ||
run: cargo clippy --tests | ||
|
||
- name: Check docs | ||
run: cargo doc --no-deps | ||
|
||
unit: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-11 | ||
- windows-latest | ||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
# Disable full debug symbol generation to speed up CI build and keep memory down | ||
RUSTFLAGS: -C debuginfo=line-tables-only | ||
# Disable incremental builds by cargo for CI which should save disk space | ||
# and hopefully avoid final link "No space left on device" | ||
CARGO_INCREMENTAL: 0 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install minimal stable with clippy and rustfmt | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: default | ||
toolchain: "stable" | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run unit tests | ||
run: cargo test --lib | ||
|
||
integration: | ||
strategy: | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:alpine | ||
env: | ||
POSTGRES_DB: sharing | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: secret | ||
ports: | ||
- 5432:5432 | ||
env: | ||
# Disable full debug symbol generation to speed up CI build and keep memory down | ||
RUSTFLAGS: -C debuginfo=line-tables-only | ||
# Disable incremental builds by cargo for CI which should save disk space | ||
# and hopefully avoid final link "No space left on device" | ||
CARGO_INCREMENTAL: 0 | ||
DATABASE_URL: postgres://postgres:[email protected]:5432/sharing | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install minimal stable with clippy and rustfmt | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: default | ||
toolchain: "stable" | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run integration tests | ||
run: cargo test --tests |
Oops, something went wrong.