testing new db approach on CI #928
Workflow file for this run
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: Rust | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
SQLX_OFFLINE: true | |
MIN_PAYMENT_AMT: 100 | |
INVOICE_EXPIRATION_WINDOW: 3600 | |
DATABASE_URL: sqlite://./mostro.db | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- uses: actions/checkout@v4 | |
- name: Install sqlx | |
run: cargo install sqlx-cli --version 0.6.2 | |
- name: Init DB | |
run: sqlx database create | |
- name: Run migrations | |
run: sqlx migrate run | |
- name: Prepare offline file | |
run: cargo sqlx prepare | |
- name: Check offline file | |
run: cargo sqlx prepare --check | |
- name: Commit mostro.db and sqlx-data.json | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: Show GitHub Actions logo | |
committer_name: GitHub Actions | |
committer_email: [email protected] | |
add: | | |
- mostro.db | |
- sqlx-data.json | |
- name: Run tests | |
run: cargo test --verbose |