Skip to content

Commit

Permalink
ci: ediotast: move openapi sync to another job
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptiste Prevot committed Aug 9, 2023
1 parent 08e1281 commit 009db82
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/editoast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ on:
- prod

jobs:
openapi:
name: Check openapi.yaml sync
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# run the CI on the actual latest commit of the PR, not the attempted merge
ref: ${{ github.event.pull_request.head.sha }}

- name: Install lib posgresql & geos
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev libgeos-dev
- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true

- name: Load cached target
uses: actions/cache@v3
id: cached-cargo-dependencies
with:
path: editoast/target/
key: osrd-editoast-openapi-target-${{ hashFiles('editoast/Cargo.lock') }}

- name: Check openapi.yaml sync
run: diff <(cargo run --release --manifest-path editoast/Cargo.toml -- openapi) editoast/openapi.yaml

editoast_tests:
name: Tests editoast and check coverage
runs-on: ubuntu-latest
Expand Down Expand Up @@ -61,9 +93,6 @@ jobs:
path: editoast/target/
key: osrd-editoast-target-${{ hashFiles('editoast/Cargo.lock') }}

- name: Check openapi.yaml sync
run: diff <(cargo run --release --manifest-path editoast/Cargo.toml -- openapi) editoast/openapi.yaml

- name: Install tarpaulin
run: cargo install cargo-tarpaulin

Expand Down Expand Up @@ -121,6 +150,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets --manifest-path=editoast/Cargo.toml -- -D warnings

- name: Documentation check
run: cargo doc --manifest-path editoast/Cargo.toml
env:
Expand Down

0 comments on commit 009db82

Please sign in to comment.