Skip to content

Commit

Permalink
Retrofit template with all the videocall stuff (#23)
Browse files Browse the repository at this point in the history
* update ci, cache crates, go fast

* save

* update docker images

* add help commands

* config.toml

* justin tv and twitch

* clippy

* fmt

* remove cache

---------

Co-authored-by: Dario Lencina <[email protected]>
  • Loading branch information
darioalessandro and Dario Lencina authored Jul 21, 2023
1 parent 100328a commit f0abdf7
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 132 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

on:
pull_request:
paths:
- 'actix-api/**'
- 'types/**'
- Dockerfile.actix

name: check backend

env:
ACTIX_PORT: 8080
TRUNK_SERVE_PORT: 80
TRUNK_SERVE_HOST: localhost
OAUTH_CLIENT_ID: OAUTH_CLIENT_ID
OAUTH_AUTH_URL: OAUTH_AUTH_URL
OAUTH_TOKEN_URL: OAUTH_TOKEN_URL
OAUTH_CLIENT_SECRET: OAUTH_CLIENT_SECRET
OAUTH_REDIRECT_URL: http://localhost:${ACTIX_PORT:-8080}/login/callback
RUST_LOG: info
PG_URL: postgres://postgres:docker@postgres:5432/actix-api-db?sslmode=disable

jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
with:
components: clippy, rustfmt
- run: cd actix-api && cargo clippy -- --deny warnings
- run: cd actix-api && cargo fmt --check
- run: cd actix-api && cargo test
22 changes: 0 additions & 22 deletions .github/workflows/cargo-audit.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/cargo-lint.yaml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/cargo-test.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

on:
pull_request:
paths:
- 'yew-ui/**'
- 'types/**'
- Dockerfile.yew
- nginx.conf


name: check frontend

env:
ACTIX_PORT: {ACTIX_PORT:-8080}
TRUNK_SERVE_PORT: ${TRUNK_SERVE_PORT:-80}
ENABLE_OAUTH: true
LOGIN_URL: http://localhost:${ACTIX_PORT:-8080}/login

jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
with:
components: clippy, rustfmt
# - run: cd yew-ui && cargo clippy -- --deny warnings
- run: rustup target add wasm32-unknown-unknown
- run: cd yew-ui && cargo fmt --check
- run: cd yew-ui && cargo test
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@ build:
docker compose -f docker/docker-compose.yaml build

connect_to_db:
docker compose -f docker/docker-compose.yaml run postgres bash -c "psql -h postgres -d actix-api-db -U postgres"
docker compose -f docker/docker-compose.yaml run postgres bash -c "psql -h postgres -d actix-api-db -U postgres"


fmt:
docker compose -f docker/docker-compose.yaml run yew-ui bash -c "cd app/yew-ui && cargo fmt"
docker compose -f docker/docker-compose.yaml run actix-api bash -c "cd app/actix-api && cargo fmt && cd ../types && cargo fmt"

clippy-fix:
docker compose -f docker/docker-compose.yaml run yew-ui bash -c "cd app/yew-ui && cargo clippy --fix"
docker compose -f docker/docker-compose.yaml run actix-api bash -c "cd app/actix-api && cargo clippy --fix && cd ../types && cargo clippy --fix"

check:
# The ui does not support clippy yet
docker compose -f docker/docker-compose.yaml run yew-ui bash -c "cd app/yew-ui && cargo clippy --all -- --deny warnings && cargo fmt --check"
docker compose -f docker/docker-compose.yaml run actix-api bash -c "cd app/actix-api && cargo clippy --all -- --deny warnings && cargo fmt --check"
2 changes: 2 additions & 0 deletions actix-api/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[net]
git-fetch-with-cli = true
80 changes: 59 additions & 21 deletions actix-api/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f0abdf7

Please sign in to comment.