### Quick Start GitHub Actions Checkout and LUMOS Action Source: https://github.com/getlumos/lumos-action/blob/main/README.md The most basic setup for using the LUMOS Generate action in a GitHub Actions workflow. It checks out the repository and then runs the LUMOS action with a specified schema pattern. ```yaml - uses: actions/checkout@v4 - uses: getlumos/lumos-action@v1 with: schema: 'schemas/**/*.lumos' ``` -------------------------------- ### Monorepo LUMOS Schema Generation Example Source: https://github.com/getlumos/lumos-action/blob/main/README.md This example demonstrates how to configure the LUMOS Generate action to process multiple schema files in a monorepo structure. The 'schema' input accepts a multi-line string to specify individual schema file paths. ```yaml - name: Generate all schemas uses: getlumos/lumos-action@v1 with: schema: | programs/nft/schema.lumos programs/defi/schema.lumos programs/gaming/schema.lumos ``` -------------------------------- ### Advanced LUMOS Action Configuration Source: https://github.com/getlumos/lumos-action/blob/main/README.md An example showcasing advanced configuration options for the LUMOS Generate action, including specifying a custom LUMOS CLI version, setting a working directory, disabling failure on drift, and enabling PR comments. ```yaml - name: Generate with custom version uses: getlumos/lumos-action@v1 with: schema: 'programs/**/schema.lumos' version: '0.1.1' working-directory: './backend' fail-on-drift: false comment-on-pr: true ``` -------------------------------- ### Local Testing with 'act' for LUMOS Action Source: https://github.com/getlumos/lumos-action/blob/main/CLAUDE.md Instructions for installing and using 'act', a GitHub Actions local runner, to test workflows. This includes listing available workflows and testing the 'pull_request' workflow. ```bash # Install act (GitHub Actions local runner) brew install act # Test the action locally act -l # List workflows act pull_request # Test PR workflow ``` -------------------------------- ### Testing LUMOS Action in a Real Repository Source: https://github.com/getlumos/lumos-action/blob/main/CLAUDE.md Example of a GitHub Actions workflow file to test the LUMOS Action in a real repository. It checks out the code and uses the LUMOS Action from the main branch, specifying a schema file. ```yaml name: Test LUMOS Action on: [push] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: getlumos/lumos-action@main # Test from main branch with: schema: 'test/schema.lumos' ``` -------------------------------- ### LUMOS Generation with Specific Version Pinning Source: https://github.com/getlumos/lumos-action/blob/main/README.md An example of pinning the LUMOS CLI to a specific version ('0.1.1') for schema generation. This ensures consistency across CI runs by avoiding unexpected behavior from the latest version. ```yaml - name: Generate with pinned version uses: getlumos/lumos-action@v1 with: schema: 'schema.lumos' version: '0.1.1' ``` -------------------------------- ### Version-Pinned LUMOS Generation with Custom Working Directory Source: https://context7.com/getlumos/lumos-action/llms.txt This workflow demonstrates installing a specific version of the LUMOS CLI for reproducible builds and generating code from a custom working directory. It requires 'actions/checkout' and 'getlumos/lumos-action'. Inputs include 'schema', 'version', 'working-directory', 'fail-on-drift', and 'comment-on-pr'. ```yaml name: LUMOS Generate with Version Pin on: [push] jobs: generate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Generate with specific version uses: getlumos/lumos-action@v1 with: schema: 'programs/**/schema.lumos' version: '0.1.1' working-directory: './backend' fail-on-drift: false comment-on-pr: true ``` -------------------------------- ### Auto-commit Generated LUMOS Files in GitHub Actions Source: https://github.com/getlumos/lumos-action/blob/main/README.md This example demonstrates how to automatically commit generated files after the LUMOS action runs. It configures git, adds all changes, commits them, and pushes them back to the repository. ```yaml - uses: getlumos/lumos-action@v1 with: schema: 'schema.lumos' fail-on-drift: false - name: Commit generated files run: | git config user.name "LUMOS Bot" git config user.email "bot@lumos-lang.org" git add . git commit -m "chore: Update generated files" || exit 0 git push ``` -------------------------------- ### Publishing Updates for LUMOS Action Source: https://github.com/getlumos/lumos-action/blob/main/CLAUDE.md Commands for tagging a new version, updating the major version tag, and creating a GitHub Release. Ensure to check 'Publish to Marketplace' in the release UI for public distribution. ```bash # Tag new version git tag -a v1.0.1 -m "Release v1.0.1 - Bug fixes" git push origin v1.0.1 # Update major version tag git tag -fa v1 -m "Latest v1.x release" git push origin v1 --force # Create GitHub Release gh release create v1.0.1 --title "v1.0.1" --notes "..." # Check "Publish to Marketplace" in release UI ``` -------------------------------- ### Lumos CLI Latest with Warning Mode Source: https://context7.com/getlumos/lumos-action/llms.txt This workflow demonstrates using the latest LUMOS CLI version to generate code or validate schemas, reporting any detected drift as warnings instead of build failures. It's useful for CI/CD pipelines where immediate failure is not desired for minor drift. The action is configured with `version: 'latest'`, `fail-on-drift: false`, and `comment-on-pr: true`. ```yaml name: LUMOS Generate (Warning Mode) on: [push] jobs: generate-warn: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Generate with warnings uses: getlumos/lumos-action@v1 with: schema: 'schemas/*.lumos' version: 'latest' fail-on-drift: false comment-on-pr: true ``` -------------------------------- ### Basic LUMOS Schema Generation Workflow Source: https://github.com/getlumos/lumos-action/blob/main/README.md A standard GitHub Actions workflow to check out code and use the LUMOS Generate action to process schema files. It defaults to validating and generating code from schemas found in 'schemas/**/*.lumos'. ```yaml name: LUMOS Generate on: [push, pull_request] jobs: generate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Generate from LUMOS schemas uses: getlumos/lumos-action@v1 with: schema: 'schemas/**/*.lumos' ``` -------------------------------- ### Monorepo Multi-Schema Generation with LUMOS Source: https://context7.com/getlumos/lumos-action/llms.txt This workflow processes multiple LUMOS schema files across different projects within a monorepo structure. It is triggered on push to 'main' or pull requests affecting '.lumos' files. The 'schema' input accepts a multi-line string listing individual schema files. ```yaml name: Monorepo LUMOS Generation on: push: branches: [main] pull_request: paths: - '**/*.lumos' jobs: generate-all: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Generate all schemas uses: getlumos/lumos-action@v1 with: schema: | programs/nft/schema.lumos programs/defi/schema.lumos programs/gaming/schema.lumos ``` -------------------------------- ### Using LUMOS Action Outputs in GitHub Workflows Source: https://context7.com/getlumos/lumos-action/llms.txt This workflow demonstrates how to capture and utilize the outputs of the 'getlumos/lumos-action' for conditional workflow steps. It assigns an 'id' to the action step and references its outputs (e.g., 'schemas-validated', 'drift-detected') in subsequent 'run' or 'if' conditions. ```yaml name: LUMOS with Outputs on: [pull_request] jobs: generate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Generate and capture outputs id: lumos-gen uses: getlumos/lumos-action@v1 with: schema: 'schemas/*.lumos' - name: Report results run: | echo "Validated: ${{ steps.lumos-gen.outputs.schemas-validated }} schemas" echo "Generated: ${{ steps.lumos-gen.outputs.schemas-generated }} schemas" echo "Drift detected: ${{ steps.lumos-gen.outputs.drift-detected }}" - name: Notify on drift if: steps.lumos-gen.outputs.drift-detected == 'true' run: | echo "::warning::Generated files differ from committed versions" echo "${{ steps.lumos-gen.outputs.diff-summary }}" ``` -------------------------------- ### Pre-commit Hook Alternative using LUMOS Action Source: https://github.com/getlumos/lumos-action/blob/main/README.md This workflow configures the LUMOS Generate action to act as a pre-commit check within a CI pipeline. It triggers only on changes to LUMOS schema files and runs in 'check-only' mode. ```yaml on: pull_request: paths: - '**/*.lumos' jobs: check-schemas: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: getlumos/lumos-action@v1 with: schema: '**/*.lumos' check-only: true ``` -------------------------------- ### LUMOS Generation with Custom Failure Behavior Source: https://github.com/getlumos/lumos-action/blob/main/README.md This configuration shows how to customize the failure behavior of the LUMOS Generate action. By setting 'fail-on-drift' to false, the action will only warn about detected drift instead of failing the job. ```yaml - name: Generate with warnings only uses: getlumos/lumos-action@v1 with: schema: 'schemas/*.lumos' fail-on-drift: false # Only warn, don't fail ``` -------------------------------- ### Schema Pre-Commit Check using Lumos Action Source: https://context7.com/getlumos/lumos-action/llms.txt This workflow triggers a schema validation check only when Lumos schema files (`.lumos`) are modified in a pull request. It uses the `getlumos/lumos-action` with `check-only` and `comment-on-pr` options enabled to provide feedback directly on the pull request. ```yaml name: Schema Pre-Commit Check on: pull_request: paths: - '**/*.lumos' jobs: check-schemas: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Validate schema changes uses: getlumos/lumos-action@v1 with: schema: '**/*.lumos' check-only: true comment-on-pr: true ``` -------------------------------- ### LUMOS Schema Validation Only Workflow Source: https://github.com/getlumos/lumos-action/blob/main/README.md This workflow demonstrates how to use the LUMOS Generate action solely for validation purposes, typically within a pull request check. It enables 'check-only' and 'fail-on-drift' to ensure schema integrity without generating files. ```yaml name: LUMOS Validate on: [pull_request] jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Validate LUMOS schemas uses: getlumos/lumos-action@v1 with: schema: 'schemas/**/*.lumos' check-only: true fail-on-drift: true ``` -------------------------------- ### Auto-Commit Generated LUMOS Files in GitHub Actions Source: https://context7.com/getlumos/lumos-action/llms.txt This workflow generates code from LUMOS schemas and automatically commits the changes back to the repository. It uses 'actions/checkout' and 'getlumos/lumos-action'. After generation, it configures Git, stages changes, commits them, and pushes back to the branch. ```yaml name: Auto-Generate and Commit on: push: branches: [develop] jobs: generate-and-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Generate from schemas uses: getlumos/lumos-action@v1 with: schema: 'schema.lumos' fail-on-drift: false - name: Commit generated files run: | git config user.name "LUMOS Bot" git config user.email "bot@lumos-lang.org" git add . git commit -m "chore: Update generated files [skip ci]" || exit 0 git push ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.