Skip to content

Commit

Permalink
Merge pull request #34 from LRZ-BADW/initial-api
Browse files Browse the repository at this point in the history
Start API Rewrite
  • Loading branch information
gierens authored Sep 6, 2024
2 parents 08ada8d + 322f270 commit bc8147a
Show file tree
Hide file tree
Showing 28 changed files with 2,686 additions and 127 deletions.
2 changes: 2 additions & 0 deletions .deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ ignore = [
#{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" },
#"[email protected]", # you can also ignore yanked crate versions if you wish
#{ crate = "[email protected]", reason = "you can specify why you are ignoring the yanked crate" },
{ id = "RUSTSEC-2024-0320", reason = "Nothing we can do about it now." },
{ id = "RUSTSEC-2024-0370", reason = "Nothing we can do about it now." },
]
# If this is true, then cargo deny will use the git executable to fetch advisory database.
# If this is false, then it uses a built-in git library.
Expand Down
32 changes: 23 additions & 9 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
api:
- changed-files:
- any-glob-to-any-file: api/*
- any-glob-to-any-file: "api/*"

lib:
- changed-files:
- any-glob-to-any-file: lib/*
- any-glob-to-any-file: "lib/*"

cli:
- changed-files:
- any-glob-to-any-file: cli/*
- any-glob-to-any-file: "cli/*"

tests:
dep:
- changed-files:
- any-glob-to-any-file: **/tests/*
- any-glob-to-any-file:
- "Cargo.*"
- "**/Cargo.*"

src:
- changed-files:
- any-glob-to-any-file: "**/src/**/*"

deps:
test:
- changed-files:
- any-glob-to-any-file:
- Cargo.*
- **/Cargo.*
- "tests/**/*"
- "**/tests/**/*"

db:
- changed-files:
- any-glob-to-any-file: "api/migrations/*"

sh:
- changed-files:
- any-glob-to-any-file: "scripts/*"

ci:
- changed-files:
- any-glob-to-any-file: .github/**/*
- any-glob-to-any-file: ".github/**/*"
1 change: 1 addition & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
pull_request:
paths:
- '.github/workflows/audit.yml'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: commit

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
pull-requests: write

steps:
- uses: actions/labeler@v5
- name: Check out repository code
uses: actions/checkout@v4
- name: Label the PR
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: lint

on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
pull_request:
branches:
- 'main'
Expand Down
40 changes: 32 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: test

on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
pull_request:
branches:
- 'main'
Expand All @@ -16,22 +19,43 @@ on:

env:
CARGO_TERM_COLOR: always
SQLX_VERSION: 0.7.3
SQLX_FEATURES: "rustls,postgres"

jobs:
test:
name: test
runs-on: ubuntu-latest
# container:
# image: xd009642/tarpaulin
# options: --security-opt seccomp=unconfined
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
ports:
- 5432:5432
steps:
- name: checkout
- name: Check out repository code
uses: actions/checkout@v4
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: install rust cache
- name: Rust Cache Action
uses: Swatinem/rust-cache@v2
- name: run tests
with:
key: sqlx-${{ env.SQLX_VERSION }}
- name: Install sqlx-cli
run:
cargo install sqlx-cli
--version=${{ env.SQLX_VERSION }}
--features ${{ env.SQLX_FEATURES }}
--no-default-features
--locked
- name: Install postgresql-client and mold
run: sudo apt update && sudo apt install postgresql-client mold -y
- name: Migrate database
run: SKIP_DOCKER=true ./scripts/init_db.sh
- name: Check sqlx offline data is up to date
run: cargo sqlx prepare --workspace --check
- name: Run tests
run: cargo test

# coverage:
Expand Down
Loading

0 comments on commit bc8147a

Please sign in to comment.