Rewrite local Executor in Rust and Svelte #10
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| rust: | |
| name: Rust | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| env: | |
| EXECUTOR_WEB_ASSETS_DIR: tests/fixtures/web-assets | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust toolchain | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| rustup toolchain install 1.96.0 \ | |
| --profile minimal \ | |
| --component clippy,rustfmt | |
| rustup override set 1.96.0 | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@401aff9a7a08acb9d27b64936a90db81024cff97 # v2.8.2 | |
| with: | |
| cache-on-failure: false | |
| shared-key: rust-1.96.0 | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Check all targets and features | |
| run: cargo check --locked --all-targets --all-features | |
| - name: Lint all targets and features | |
| run: cargo clippy --locked --all-targets --all-features -- -D warnings | |
| - name: Set up Bun for emulator-backed Rust tests | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Install locked emulator dependency | |
| run: bun install --frozen-lockfile --ignore-scripts | |
| - name: Verify OAuth test emulator | |
| run: test -x e2e/node_modules/.bin/emulate | |
| - name: Test all targets and features | |
| run: cargo test --locked --all-targets --all-features | |
| web: | |
| name: Svelte web | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Check formatting | |
| run: bun run format:check | |
| working-directory: web | |
| - name: Lint | |
| run: bun run lint | |
| working-directory: web | |
| - name: Typecheck | |
| run: bun run typecheck | |
| working-directory: web | |
| - name: Test | |
| run: bun run test | |
| working-directory: web | |
| format: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.11 | |
| - run: bun install --frozen-lockfile | |
| - run: bun run format:check | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.11 | |
| - run: bun install --frozen-lockfile | |
| - run: bun run lint | |
| typecheck: | |
| name: Typecheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.11 | |
| - run: bun install --frozen-lockfile | |
| - run: bun run typecheck | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.11 | |
| - run: bun install --frozen-lockfile | |
| - run: bun run test | |
| - name: Test release workflow and Docker contracts | |
| run: bun run test:release:static | |
| - name: Test release archive installer | |
| run: bun run test:release:installer | |
| - name: Test systemd master-key lifecycle | |
| run: bun run test:release:systemd | |
| - name: Check release shell scripts | |
| run: bun run test:release:shell | |
| local-selfhost-e2e: | |
| name: Local self-host e2e | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Install Rust toolchain | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| rustup toolchain install 1.96.0 --profile minimal | |
| rustup override set 1.96.0 | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@401aff9a7a08acb9d27b64936a90db81024cff97 # v2.8.2 | |
| with: | |
| cache-on-failure: false | |
| shared-key: rust-1.96.0-local-selfhost-e2e | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Install Chromium | |
| run: bun run --cwd e2e playwright install --with-deps chromium | |
| - name: Run local self-host e2e | |
| run: bun run test:e2e | |
| - name: Upload e2e artifacts | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: local-selfhost-e2e | |
| path: e2e/runs/ | |
| if-no-files-found: error | |
| retention-days: 14 | |
| selfhost-docker-smoke: | |
| name: Rust self-host Docker image | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Build self-host image | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| load: true | |
| push: false | |
| tags: executor-selfhost:ci | |
| - name: Smoke test container health and shutdown | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| docker volume create executor-ci-data >/dev/null | |
| docker run --detach \ | |
| --name executor-ci \ | |
| --init \ | |
| --read-only \ | |
| --cap-drop ALL \ | |
| --security-opt no-new-privileges \ | |
| --memory 2g \ | |
| --pids-limit 512 \ | |
| --tmpfs /tmp:rw,noexec,nosuid,nodev,size=64m \ | |
| --mount source=executor-ci-data,target=/var/lib/executor \ | |
| executor-selfhost:ci >/dev/null | |
| status="starting" | |
| for _ in {1..60}; do | |
| status="$(docker inspect --format '{{.State.Health.Status}}' executor-ci)" | |
| if [[ "$status" == "healthy" ]]; then | |
| break | |
| fi | |
| if [[ "$(docker inspect --format '{{.State.Status}}' executor-ci)" == "exited" ]]; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| if [[ "$status" != "healthy" ]]; then | |
| docker logs executor-ci | |
| exit 1 | |
| fi | |
| docker stop --time 120 executor-ci >/dev/null | |
| test "$(docker inspect --format '{{.State.ExitCode}}' executor-ci)" = "0" | |
| - name: Clean up container smoke test | |
| if: always() | |
| run: | | |
| docker rm --force executor-ci >/dev/null 2>&1 || true | |
| docker volume rm --force executor-ci-data >/dev/null 2>&1 || true |