migration changes #728
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 and Formatting | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
everything: | |
name: Rust/JS Checks/Formatting | |
runs-on: ubuntu-latest | |
env: | |
FASTN_DB_URL: postgres://testuser:testpassword@localhost:5432/testdb | |
DEBUG: true | |
FASTN_ENABLE_AUTH: true | |
FASTN_ENABLE_EMAIL: false | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_DB: testdb | |
POSTGRES_USER: testuser | |
POSTGRES_PASSWORD: testpassword | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
override: true | |
components: rustfmt, clippy | |
# - name: Set up cargo cache | |
# uses: actions/cache@v3 # there is also https://github.com/Swatinem/rust-cache | |
# continue-on-error: false | |
# with: | |
# path: | | |
# ~/.cargo/registry/index/ | |
# ~/.cargo/registry/cache/ | |
# ~/.cargo/git/db/ | |
# target/ | |
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# restore-keys: ${{ runner.os }}-cargo- | |
- name: Run cargo fmt | |
id: fmt | |
continue-on-error: true | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run cargo clippy | |
id: clippy | |
continue-on-error: true | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --tests -- -D warnings | |
# - name: Install cargo check tools | |
# run: | | |
# cargo install --locked cargo-deny || true | |
# cargo install --locked cargo-outdated || true | |
# cargo install --locked cargo-udeps || true | |
# cargo install --locked cargo-audit || true | |
# cargo install --locked cargo-pants || true | |
# - name: Check | |
# run: | | |
# cargo deny check | |
# cargo outdated --exit-code 1 | |
# cargo udeps | |
# rm -rf ~/.cargo/advisory-db | |
# cargo audit | |
# cargo pants | |
- name: Run cargo test | |
id: test | |
continue-on-error: true | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
- name: Run integration tests | |
id: integration-test | |
continue-on-error: true | |
run: | | |
bash .github/scripts/run-integration-tests.sh | |
- name: Check if JS code is properly formatted | |
# curl -fsSL https://dprint.dev/install.sh | sh | |
# /Users/amitu/.dprint/bin/dprint fmt --config .github/dprint-ci.json | |
id: js-fmt | |
uses: dprint/[email protected] | |
with: | |
config-path: .github/dprint-ci.json | |
- name: Check if code is properly formatted | |
if: steps.fmt.outcome != 'success' | |
run: exit 1 | |
- name: Check if clippy is happy | |
if: steps.clippy.outcome != 'success' | |
run: exit 1 | |
- name: Check if js-fmt is happy | |
if: steps.js-fmt.outcome != 'success' | |
run: exit 1 | |
- name: Check if test succeeded | |
if: steps.test.outcome != 'success' | |
run: exit 1 | |
- name: Check if integration test passed | |
if: steps.integration-test.outcome != 'success' | |
run: exit 1 |