From 85149c3973bb202efa0e7af4fa872d0cd0930370 Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 9 Oct 2024 15:23:48 +0200 Subject: [PATCH] add ci generation check --- .github/workflows/generate-files.yml | 27 +++++++++++++++++++++++++++ go-idl/readme.md | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/generate-files.yml diff --git a/.github/workflows/generate-files.yml b/.github/workflows/generate-files.yml new file mode 100644 index 0000000..0239eee --- /dev/null +++ b/.github/workflows/generate-files.yml @@ -0,0 +1,27 @@ +name: Generated Files are Updated +on: + merge_group: + pull_request: + branches: + - "*" + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Generate Go code, docs and specs + env: + TEST_ENV: ${{ github.workspace }} + run: make generate + + - name: Check for changes + run: | + if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol; then + echo "Generated Go files are up-to-date." + else + echo "::error::Generated files are not up-to-date. Please run 'make generate' locally and commit any changes." + exit 1 + fi diff --git a/go-idl/readme.md b/go-idl/readme.md index 9544168..b78dd63 100644 --- a/go-idl/readme.md +++ b/go-idl/readme.md @@ -2,6 +2,6 @@ This is a minimalist library to generate Go code to work with Solana programs given its IDL. -- `typpes`: contains type definitions for the IDL. +- `types`: contains type definitions for the IDL. - `generator`: contains the code to generate Go code from the IDL. - `generated`: contains the generated Go code. \ No newline at end of file