cue #237
Workflow file for this run
This file contains hidden or 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: cue | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| pull_request: | |
| merge_group: | |
| release: | |
| types: | |
| - published | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref_name != 'main' }} | |
| jobs: | |
| check-cue-gen: | |
| name: "check generated CUE files" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v7 | |
| - uses: perses/github-actions@v0.12.0 | |
| - uses: ./.github/perses-ci/actions/setup_environment | |
| with: | |
| enable_go: true | |
| enable_cue: true | |
| cue_version: "v0.15.4" | |
| - name: generate .cue model files | |
| run: make cue-gen | |
| - name: check for changes | |
| run: | | |
| git add . | |
| if ! git diff --cached --exit-code; then | |
| echo "The generated .cue model files are not up to date. Please run 'make cue-gen' locally and commit the changes." | |
| exit 1 | |
| fi | |
| validate-schemas: | |
| name: validate CUE schemas | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v7 | |
| - uses: perses/github-actions@v0.12.0 | |
| - uses: ./.github/perses-ci/actions/setup_environment | |
| with: | |
| enable_go: true | |
| enable_cue: true | |
| cue_version: "v0.15.4" | |
| - name: check that CUE schemas evaluate correctly | |
| run: make cue-eval | |
| - name: run the unit tests for CUE schemas | |
| run: make cue-test | |
| publish-module: | |
| name: "publish module to Central Registry" | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.release.tag_name }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: perses/github-actions@v0.12.0 | |
| - uses: ./.github/perses-ci/actions/setup_environment | |
| with: | |
| enable_go: true | |
| enable_cue: true | |
| cue_version: "v0.15.4" | |
| - name: Login to Central Registry # to allow publishing the module | |
| run: cue login --token=${{ secrets.CUE_REG_TOKEN }} | |
| - name: Publish the module | |
| run: cue mod publish ${{ github.ref_name }} | |
| working-directory: cue |