Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #68 from FerrisChat/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
tazz4843 authored Nov 20, 2021
2 parents 18eff88 + 67c85a8 commit cd74043
Show file tree
Hide file tree
Showing 20 changed files with 1,740 additions and 1,427 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- gh-actions-fixes


name: Linters
Expand Down Expand Up @@ -31,6 +32,20 @@ jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest

services:
postgres:
image: "postgres:latest"
env:
POSTGRES_PASSWORD: "postgres"
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: "install ld"
run: "sudo apt install lld -y"
Expand All @@ -42,11 +57,21 @@ jobs:
toolchain: nightly
components: clippy
override: true

- uses: Swatinem/rust-cache@v1

- uses: actions-rs/clippy-check@v1
- name: "install sqlx cli"
run: "cargo install sqlx-cli"

- name: "run database migrations"
run: "cargo sqlx database setup"
env:
SQLX_OFFLINE: "true"
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"

- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- --forbid expect_used --forbid unwrap_used
name: Clippy Output
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"
59 changes: 59 additions & 0 deletions .github/workflows/sqlx-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
pull_request:

push:
branches:
- main
- gh-actions-fixes

name: "SQLx Checks"

jobs:
sqlx_check:
name: "SQLx Check"
runs-on: ubuntu-latest

services:
postgres:
image: "postgres:latest"
env:
POSTGRES_PASSWORD: "postgres"
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: "checkout repo"
uses: actions/checkout@v2

- name: "install rust"
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- uses: Swatinem/rust-cache@v1

- name: "install sqlx-cli"
run: "cargo install sqlx-cli"

- name: "save current sqlx-data.json"
run: "mv sqlx-data.json sqlx-data.json.old || touch sqlx-data.json.old"

- name: "migrate db"
run: "cargo sqlx database setup"
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"

- name: "regenerate sqlx-data.json"
run: "cargo sqlx prepare"
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"

- name: "assert eq, update if not eq"
run: "diff -q sqlx-data.json sqlx-data.json.old || { git config user.name github-actions; git config user.email [email protected]; git add sqlx-data.json; git commit -m \"automated sqlx-data.json update\"; }"
Loading

0 comments on commit cd74043

Please sign in to comment.