# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json name: CI on: push: branches: [main, develop] pull_request: branches: [main, develop] env: CARGO_TERM_COLOR: always SQLX_OFFLINE: true SQLX_OFFLINE_DIR: "./.sqlx" jobs: setup-and-build: name: Setup and Build All runs-on: ubuntu-latest outputs: rust-cache-key: ${{ steps.rust-cache.outputs.cache-hit }} node-cache-key: ${{ steps.node-cache.outputs.cache-hit }} steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup environment uses: ./.github/actions/setup with: setup-rust: "true" setup-node: "true" cache-key-suffix: "ci-build" - name: Setup SQLx offline files run: ./scripts/setup-sqlx-offline.sh - name: Build Node packages run: pnpm build - name: Build Rust workspace (x86_64) run: | cargo build --release --all-features --workspace - name: Collect executables (x86_64) run: | mkdir -p artifacts/x86_64 # Copy all executables from unified workspace if [ -d "target/release" ]; then find target/release -maxdepth 1 -type f -executable ! -name "*.d" ! -name "*-*" -exec cp {} artifacts/x86_64/ \; fi echo "x86_64 executables:" ls -la artifacts/x86_64/ || echo "No executables found" - name: Upload Node build artifacts uses: actions/upload-artifact@v4 with: name: node-builds path: | packages/*/dist/ apps/amethyst/build/ retention-days: 1 - name: Upload Rust build artifacts uses: actions/upload-artifact@v4 with: name: rust-builds-x86_64 path: | artifacts/x86_64/ retention-days: 1 rust-cross-compile: name: Cross-compile Rust runs-on: ubuntu-latest needs: setup-and-build strategy: matrix: target: [aarch64-unknown-linux-gnu] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup environment uses: ./.github/actions/setup with: setup-rust: "true" setup-node: "true" lexicons-only-rust: "true" cache-key-suffix: "cross-${{ matrix.target }}" - name: Setup SQLx offline files run: ./scripts/setup-sqlx-offline.sh - name: Install cross-compilation tools run: | cargo install cross --git https://github.com/cross-rs/cross rustup target add ${{ matrix.target }} # Set up environment for cross-compilation echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV echo "CROSS_NO_WARNINGS=0" >> $GITHUB_ENV - name: Cross-compile workspace run: | cross build --release --all-features --workspace --target ${{ matrix.target }} - name: Collect cross-compiled executables run: | mkdir -p artifacts/${{ matrix.target }} # Copy all executables from unified workspace if [ -d "target/${{ matrix.target }}/release" ]; then find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable ! -name "*.d" ! -name "*-*" -exec cp {} artifacts/${{ matrix.target }}/ \; fi echo "Cross-compiled executables for ${{ matrix.target }}:" ls -la artifacts/${{ matrix.target }}/ || echo "No executables found" - name: Upload cross-compiled artifacts uses: actions/upload-artifact@v4 with: name: rust-builds-${{ matrix.target }} path: | artifacts/${{ matrix.target }}/ retention-days: 1 # disabled b/c it's triggered on autogenerated content # and can't find a way around it rn # rust-quality: # name: Rust Quality Checks # runs-on: ubuntu-latest # needs: setup-and-build # steps: # - name: Checkout repository # uses: actions/checkout@v4 # - name: Setup environment # uses: ./.github/actions/setup # with: # setup-rust: "true" # setup-node: "true" # lexicons-only-rust: "true" # cache-key-suffix: "ci-build" # - name: Setup SQLx offline files # run: ./scripts/setup-sqlx-offline.sh # # - name: Check Rust formatting # # run: | # # cargo fmt --all -- --check # - name: Run Clippy # run: | # cargo clippy --all-targets --all-features --workspace --exclude types -- -D warnings # - name: Run Rust tests # run: | # cargo test --all-features # node-quality: # name: Node.js Quality Checks # runs-on: ubuntu-latest # needs: setup-and-build # steps: # - name: Checkout repository # uses: actions/checkout@v4 # - name: Setup environment # uses: ./.github/actions/setup # with: # setup-node: "true" # cache-key-suffix: "ci-build" # - name: Download Node build artifacts # uses: actions/download-artifact@v4 # with: # name: node-builds # path: . # # - name: Type check # # run: pnpm typecheck # - name: Lint and format check # run: pnpm fix --check # - name: Run tests # run: pnpm test lexicon-validation: name: Lexicon Validation runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup environment uses: ./.github/actions/setup with: setup-node: "true" - name: Validate lexicons run: pnpm lex:validate - name: Check lexicon generation consistency run: | pnpm lex:gen git diff --exit-code || (echo "Lexicon files are out of sync. Run 'pnpm lex:gen' locally." && exit 1)