Skip to content

Commit

Permalink
Merge pull request arlyon#268 from mzeitlin11/verify_codegen
Browse files Browse the repository at this point in the history
CI: Add codegen verification step
  • Loading branch information
arlyon authored Aug 29, 2022
2 parents 9bd2df6 + d84c64b commit 5e65c2e
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 1,138 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/async-stripe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches:
- master
jobs:
format:
verify-codegen:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -22,10 +22,27 @@ jobs:
command: install
args: --debug cargo-make
- name: regenerate openapi
uses: actions-rs/cargo@v1
with:
command: make
args: openapi-install
- name: ensure generated files unchanged
uses: tj-actions/[email protected]
id: verify-changed-files
with:
files: |
**/*.rs
- name: report changed files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "Some files changed after code generation: ${{ steps.verify-changed-files.outputs.changed_files }}"
exit 1
- name: format
uses: actions-rs/cargo@v1
with:
command: make
args: check

clippy:
runs-on: ubuntu-20.04
strategy:
Expand Down
6 changes: 4 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ dependencies = ["openapi-delete"]

[tasks.openapi-copy]
cwd = "openapi"
command = "cp"
args = ["-a", "out/.", "../src/resources/generated"]
command = "rsync"
# --delete so that generated files don't stick around when not
# generated anymore, see https://github.com/arlyon/async-stripe/issues/229
args = ["-a", "--delete-during", "out/", "../src/resources/generated"]

[tasks.fmt]
command = "cargo"
Expand Down
1 change: 0 additions & 1 deletion src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ pub use {
source_ext::*
},
generated::payment::{
alipay_account::*,
card::*,
bank_account::*,
payment_method::*,
Expand Down
1 change: 0 additions & 1 deletion src/resources/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ pub mod core {

#[path = "generated"]
pub mod payment {
pub mod alipay_account;
pub mod bank_account;
pub mod card;
pub mod payment_method;
Expand Down
200 changes: 0 additions & 200 deletions src/resources/generated/account_service_resource_toggle_settings.rs

This file was deleted.

Loading

0 comments on commit 5e65c2e

Please sign in to comment.