feat!: switch DateTime sqlx type to timestamptz and remove PgHasArray… #145
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
name: checks | |
on: [push, pull_request] | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly --profile minimal -c rustfmt,clippy -y | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Cargo cache | |
uses: actions/cache@v4 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} | |
${{ runner.os }}-cargo | |
- name: Check | |
run: | | |
cargo check --all-features | |
- name: Lint | |
run: | | |
cargo fmt --all -- --check | |
cargo clippy --all-features -- -D warnings | |
- name: Install sqlx-cli | |
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres | |
- name: Setup postgres database | |
run: | | |
docker compose -f tests/compose.yml up -d | |
docker exec astrolabe-db-1 bash -c "until pg_isready; do sleep 1; done" | |
cp .env.example .env | |
sqlx database reset -y | |
- name: Test | |
run: cargo test --all-features | |
- name: Install cargo-llvm-cov | |
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin | |
- name: Generate coverage report | |
run: | | |
cargo llvm-cov clean --workspace | |
cargo llvm-cov --no-report --all-features | |
cargo llvm-cov report --lcov > lcov.txt | |
- name: Upload coverage report | |
if: github.ref == 'refs/heads/main' | |
uses: codecov/codecov-action@v5 | |
with: | |
files: ./lcov.txt | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |