Skip to content

Commit

Permalink
try sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
TIL-EBP committed Oct 30, 2024
1 parent 46bede1 commit 99dc179
Showing 1 changed file with 89 additions and 30 deletions.
119 changes: 89 additions & 30 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,48 +186,107 @@ jobs:
cargo install sqlx-cli --version 0.7.3 --no-default-features --features native-tls,postgres --locked --quiet
sqlx database create
sqlx migrate run
- name: test
run: |
format-api:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.73
profile: minimal
override: true
- name: Install Rust dependencies
env:
DATABASE_URL: "postgres://www-data:www-data@localhost:15432/swissgeol-local"
run: |
docker compose up -d db
docker compose logs -f &
sleep 10
cd api
cargo install sqlx-cli --version 0.7.3 --no-default-features --features native-tls,postgres --locked --quiet
sqlx database create
sqlx migrate run
- name: Run fmt
run: |
rustup component add rustfmt
cargo fmt
- name: Run clippy
run: |
rustup component add clippy
cargo clippy
test-api:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.73
profile: minimal
override: true
- name: Install Rust dependencies
env:
DATABASE_URL: "postgres://www-data:www-data@localhost:15432/swissgeol-local"
run: |
docker compose up -d db
docker compose logs -f &
sleep 10
cd api
cargo install sqlx-cli --version 0.7.3 --no-default-features --features native-tls,postgres --locked --quiet
sqlx database create
sqlx migrate run
- name: Run test
run: |
docker compose up -d
docker compose logs -f &
sleep 10
cd api
docker compose exec api cargo test --offline
test-api:
build-api:
runs-on: ubuntu-latest
needs: install-api
needs:
- test-api
- format-api
- install-api
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.73
profile: minimal
override: true
- name: Restore cached cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: cargo-registry-${{ runner.os }}-${{ hashFiles('./api/Cargo.lock') }}
restore-keys: |
cargo-registry-${{ runner.os }}-
- name: Restore cached cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: cargo-index-${{ runner.os }}-${{ hashFiles('./api/Cargo.lock') }}
restore-keys: |
cargo-index-${{ runner.os }}-
- name: Restore cached cargo build
uses: actions/cache@v4
with:
path: target
key: cargo-build-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-build-${{ runner.os }}-
- name: Run tests
run: cd api && cargo test
- name: Install Rust dependencies
env:
DATABASE_URL: "postgres://www-data:www-data@localhost:15432/swissgeol-local"
run: |
docker compose up -d db
docker compose logs -f &
sleep 10
cd api
cargo install sqlx-cli --version 0.7.3 --no-default-features --features native-tls,postgres --locked --quiet
sqlx database create
sqlx migrate run
- name: Run test
run: |
docker compose up -d
docker compose logs -f &
sleep 10
cd api
docker compose exec api cargo build
# test-api:


0 comments on commit 99dc179

Please sign in to comment.