Skip to content

Commit

Permalink
Merge pull request #69 from mvlabat/auth
Browse files Browse the repository at this point in the history
Authentication
  • Loading branch information
vladbat00 authored Jan 6, 2022
2 parents b02374b + f93d270 commit 6277b67
Show file tree
Hide file tree
Showing 63 changed files with 6,827 additions and 1,066 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[target.wasm32-unknown-unknown]
rustflags = ["--cfg=web_sys_unstable_apis"]

# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.

# NOTE: For maximum performance, build using a nightly compiler
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
build-args: |
muddle_matchmaker_url=muddle.run:8080
sentry_dsn=${{ secrets.SENTRY_DSN_CLIENT }} # a client secret is not a secret really, but nvm :)
muddle_google_client_id=${{ secrets.MUDDLE_GOOGLE_CLIENT_ID }}
deploy:
runs-on: ubuntu-latest
Expand Down
107 changes: 97 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
branches: [main]
branches: [ main ]
paths:
- '.github/workflows/**'
- 'bins/**'
Expand All @@ -10,7 +10,7 @@ on:
- '.rustfmt.toml'
- '.cargo/config'
pull_request:
branches: [main]
branches: [ main ]
paths:
- '.github/workflows/**'
- 'bins/**'
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -104,15 +104,15 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -p mr_web_client --release --target wasm32-unknown-unknown -- -D warnings
args: -p mr_web_client --release --target wasm32-unknown-unknown --features "ud-login" -- -D warnings

mr_server:
name: Check mr_server
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -166,13 +166,69 @@ jobs:
command: clippy
args: -p mr_matchmaker --release -- -D warnings

mr_lib_shared:
name: Test mr_lib_shared
mr_persistence:
name: Check mr_persistence
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
services:
postgres:
image: postgres
env:
POSTGRES_DB: mr_persistence_test
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cache-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
cache-${{ runner.os }}-cargo
- name: Migrate database
working-directory: ./bins/persistence
run: |
sudo apt-get install libpq-dev -y
cargo install sqlx-cli
sqlx migrate run --database-url postgres://postgres:postgres@localhost:5432/mr_persistence_test
- name: Check sqlx-data.json consistency
working-directory: ./bins/persistence
run: cargo sqlx prepare --check
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/mr_persistence_test
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -p mr_persistence --release -- -D warnings
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/mr_persistence_test

mr_shared_lib:
name: Test mr_shared_lib
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -193,3 +249,34 @@ jobs:
with:
command: test
args: -p mr_shared_lib

mr_client_lib:
name: Test mr_client_lib
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cache-${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}
cache-${{ runner.os }}-cargo-debug
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
if: ${{ runner.os == 'Linux' }}
- uses: actions-rs/cargo@v1
with:
command: test
args: -p mr_client_lib --features "use-udp"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store

# IDE
.idea

Expand Down
Loading

0 comments on commit 6277b67

Please sign in to comment.