fix: add workaround for Railway Private Networking delay #45
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: Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Repository | |
uses: actions/checkout@v3 | |
- name: Install PostgreSQL Client | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql-client | |
- name: Startup Built-in PostgreSQL Server | |
run: | | |
sudo systemctl start postgresql.service | |
pg_isready | |
sudo -u postgres psql -c "CREATE USER runner PASSWORD 'password'" | |
sudo -u postgres createdb -O runner quizzo | |
- name: Setup PostgreSQL Database | |
run: psql -f scripts/init.sql -1 quizzo | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Check Format | |
run: cargo fmt --check | |
- name: Check Clippy Lints | |
run: cargo clippy | |
- name: Run Tests | |
run: cargo test --all | |
env: | |
PG_USERNAME: runner | |
PG_PASSWORD: password | |
PG_HOSTNAME: 127.0.0.1 | |
PG_DATABASE: quizzo |