Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start API Rewrite #34

Merged
merged 21 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
eab476e
feat(ci): add rust label for **/*.rs to labeller
gierens Sep 6, 2024
e1c9d6e
chore(deny): add ignores for unmaintained crates: yaml-rust, proc-mac…
gierens Sep 6, 2024
287cbfc
feat(api/cargo): add minimal dependencies
gierens Sep 6, 2024
cc6553f
feat(api): add authentication module
gierens Sep 6, 2024
6b7c6fc
feat(api): add configuration module
gierens Sep 6, 2024
3e98adc
feat(api): add routes module with only health_check for now
gierens Sep 6, 2024
35ca881
feat(api): add telemetry module
gierens Sep 6, 2024
b7a1040
feat(api): add utils module
gierens Sep 6, 2024
43df3e0
feat(api): add startup module
gierens Sep 6, 2024
4971b3d
feat(api): revise main for new api
gierens Sep 6, 2024
e08c6e7
feat(api): add for now empty migrations folder
gierens Sep 6, 2024
34fdf3b
feat(api): add configuration folder with basic yaml configs
gierens Sep 6, 2024
38942bb
feat(scripts): add init_db.sh script
gierens Sep 6, 2024
3576e2a
test(api): add initial integration tests
gierens Sep 6, 2024
613eac6
fix(ci): add main as branch for push action trigger
gierens Sep 6, 2024
d15206c
feat(ci): add sql and scripts label and revise some others
gierens Sep 6, 2024
68c9e53
test(helpers): remove unneeded function assert_is_redirect_to
gierens Sep 6, 2024
ba629cd
refactor(ci): revise label names and pattern
gierens Sep 6, 2024
57b7018
feat(ci): add postgres setup to test/test job
gierens Sep 6, 2024
1d419cd
feat(ci): also run test and lint workflows at midnight
gierens Sep 6, 2024
322f270
fix(ci): add missing checkout step in test and label workflow
gierens Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading