CI #381
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: CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "17 4 * * *" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # LXMF-rs announce metadata interoperability changes merged via PR #499. | |
| LXMF_RS_REF: 3db141c4cb3f9f8370b9c311b9c573346d082ce5 | |
| jobs: | |
| web: | |
| name: Web and TypeScript | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out mobile app | |
| uses: actions/checkout@v6 | |
| with: | |
| path: rem | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: rem/package-lock.json | |
| - name: Install npm dependencies | |
| working-directory: rem | |
| run: npm ci | |
| - name: Enforce first-party source size | |
| working-directory: rem | |
| run: npm run check:source-size | |
| - name: Audit npm dependencies | |
| working-directory: rem | |
| run: npm audit --audit-level=moderate | |
| - name: Build node client | |
| working-directory: rem | |
| run: npm run node-client:build | |
| - name: Run app unit tests | |
| working-directory: rem | |
| run: npm run test:unit | |
| - name: Typecheck mobile app | |
| working-directory: rem | |
| run: npm --workspace apps/mobile run typecheck | |
| - name: Build web app | |
| working-directory: rem | |
| run: npm run web:build | |
| - name: Build mobile app | |
| working-directory: rem | |
| run: npm run mobile:build | |
| e2e: | |
| name: Playwright Matrix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out mobile app | |
| uses: actions/checkout@v6 | |
| with: | |
| path: rem | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: rem/package-lock.json | |
| - name: Install npm dependencies | |
| working-directory: rem | |
| run: npm ci | |
| - name: Install Playwright Chromium | |
| working-directory: rem | |
| run: npx playwright install --with-deps chromium | |
| - name: Run complete Playwright matrix | |
| working-directory: rem | |
| env: | |
| CHOKIDAR_USEPOLLING: "1" | |
| run: npm run test:e2e | |
| rust: | |
| name: Rust Runtime (pinned LXMF) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out mobile app | |
| uses: actions/checkout@v6 | |
| with: | |
| path: rem | |
| - name: Check out LXMF-rs | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: FreeTAKTeam/LXMF-rs | |
| path: LXMF-rs | |
| ref: ${{ env.LXMF_RS_REF }} | |
| - name: Install Rust 1.88 | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.88" | |
| components: rustfmt, clippy | |
| - name: Check locked Rust dependencies | |
| working-directory: rem | |
| run: cargo fetch --manifest-path crates/reticulum_mobile/Cargo.toml --locked | |
| - name: Check Rust formatting | |
| working-directory: rem | |
| run: | | |
| cargo fmt --manifest-path crates/reticulum_mobile/Cargo.toml --all -- --check | |
| cargo fmt --manifest-path crates/reticulum_mobile/jni-boundary-macro/Cargo.toml --all -- --check | |
| - name: Run clippy | |
| working-directory: rem | |
| run: | | |
| cargo clippy --manifest-path crates/reticulum_mobile/Cargo.toml --all-targets -- -D warnings | |
| cargo clippy --manifest-path crates/reticulum_mobile/jni-boundary-macro/Cargo.toml --all-targets -- -D warnings | |
| - name: Run Rust tests | |
| working-directory: rem | |
| run: cargo test --manifest-path crates/reticulum_mobile/Cargo.toml --locked --verbose | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| - name: Audit Rust dependencies | |
| working-directory: rem | |
| run: cargo audit --file crates/reticulum_mobile/Cargo.lock | |
| rust-current-lxmf: | |
| name: Rust Runtime (current LXMF main) | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out mobile app | |
| uses: actions/checkout@v6 | |
| with: | |
| path: rem | |
| - name: Check out current LXMF-rs main | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: FreeTAKTeam/LXMF-rs | |
| path: LXMF-rs | |
| ref: main | |
| - name: Install Rust 1.88 | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.88" | |
| components: rustfmt, clippy | |
| - name: Generate ephemeral lockfile for current LXMF | |
| working-directory: rem | |
| run: cargo generate-lockfile --manifest-path crates/reticulum_mobile/Cargo.toml | |
| - name: Fetch current Rust dependencies | |
| working-directory: rem | |
| run: cargo fetch --manifest-path crates/reticulum_mobile/Cargo.toml | |
| - name: Check Rust formatting | |
| working-directory: rem | |
| run: | | |
| cargo fmt --manifest-path crates/reticulum_mobile/Cargo.toml --all -- --check | |
| cargo fmt --manifest-path crates/reticulum_mobile/jni-boundary-macro/Cargo.toml --all -- --check | |
| - name: Run clippy | |
| working-directory: rem | |
| run: | | |
| cargo clippy --manifest-path crates/reticulum_mobile/Cargo.toml --all-targets -- -D warnings | |
| cargo clippy --manifest-path crates/reticulum_mobile/jni-boundary-macro/Cargo.toml --all-targets -- -D warnings | |
| - name: Run Rust tests | |
| working-directory: rem | |
| run: cargo test --manifest-path crates/reticulum_mobile/Cargo.toml --verbose |