Skip to content

Commit

Permalink
api_spec_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
epompeii committed Oct 3, 2023
1 parent 9dde65e commit f65df05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/bencher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ jobs:
name: perf.jpeg
path: ./lib/bencher_plot/perf.jpeg

open_api_spec:
name: OpenAPI Spec
runs-on: ubuntu-latest
needs:
- cargo_fmt
- cargo_clippy
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
with:
mold-version: ${{ env.MOLD_VERSION }}
- name: Generate OpenAPI Spec
run: cargo xtask swagger
- name: Check for changes
run: git diff --exit-code

# API Smoke Test
api_smoke_test:
name: API Smoke Test
Expand Down Expand Up @@ -528,6 +544,7 @@ jobs:
needs:
# Test
- cargo_test
- open_api_spec
- api_smoke_test
- api_smoke_test_compat
- cargo_bench
Expand Down Expand Up @@ -638,6 +655,7 @@ jobs:
needs:
# Test
- cargo_test
- open_api_spec
- api_smoke_test
- api_smoke_test_compat
- cargo_check_api_minus
Expand Down
2 changes: 2 additions & 0 deletions services/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ pub const API_VERSION: &str = env!("CARGO_PKG_VERSION");
// This is run via a `pre-push` git hook
// So if the `SWAGGER_PATH` below is ever updated
// also update `./git/hooks/pre-push` accordingly.
#[cfg(feature = "swagger")]
pub const SWAGGER_PATH: &str = "../console/src/content/api/swagger.json";
#[cfg(not(feature = "swagger"))]
pub const SWAGGER_SPEC: &str = include_str!("../../console/src/content/api/swagger.json");

0 comments on commit f65df05

Please sign in to comment.