created ts and rs files by api document #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: server | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "/server/**" | |
- .github/workflows/server.yaml | |
jobs: | |
gen-api: | |
name: generate and upload api files | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
server | |
docs/openapi.yaml | |
- name: generate api | |
run: >- | |
docker run --rm -v "${PWD}:/local" -u $(id -u) openapitools/openapi-generator-cli generate \ | |
-i /local/docs/openapi.yaml | |
-g rust | |
-o /local/server/apis | |
- name: upload api files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: apis | |
path: ./server/apis | |
format-check: | |
name: check format | |
needs: [gen-api] | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: server | |
- name: downloadload api files | |
uses: actions/download-artifact@v4 | |
with: | |
name: apis | |
path: ./server/apis | |
- name: fmt | |
run: cargo fmt --all -- --check | |
working-directory: ./server/ | |
clippy-check: | |
name: check clippy | |
needs: [gen-api] | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: server | |
- name: downloadload api files | |
uses: actions/download-artifact@v4 | |
with: | |
name: apis | |
path: ./server/apis | |
- name: clippy | |
run: cargo clippy --all-features -- -D warnings | |
working-directory: ./server/ | |
build-check: | |
name: check format | |
needs: [gen-api, format-check, clippy-check] | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: server | |
- name: downloadload api files | |
uses: actions/download-artifact@v4 | |
with: | |
name: apis | |
path: ./server/apis | |
- name: build files | |
run: cargo build --release | |
working-directory: ./server/ |