name: rust-postgresfixture CI
on:
push:
schedule:
- cron: "0 0 * * 0"
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo check
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up PostgreSQL APT repository
run: |
# From https://wiki.postgresql.org/wiki/Apt
sudo apt-get install -y postgresql-common
sudo sh /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
- name: Install various PostgreSQL versions
run: |
# See https://www.postgresql.org/support/versioning/ for official
# support information, and https://apt.postgresql.org/pub/repos/apt/
# for all available versions. At present only version 11 and above are
# officially supported upstream (and version 11 will get its final
# release in November 2023 and officially enter EOL), but there is
# still logic in rust-postgresfixture that works with versions as old
# as 9.0.
sudo apt-get install -y postgresql-{9.{0,1,2,3,4,5,6},10,11,12,13,14,15,16}
- name: Set PATH for all PostgreSQL runtimes
run: |
printf '%s\n' /usr/lib/postgresql/*/bin | sort -Vr | tee -a "$GITHUB_PATH"
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-targets -- -D warnings