name: CI on: push: branches: - master pull_request: branches: - master workflow_dispatch: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: secret-scan: name: Secret Scan runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Check Version Consistency run: | python3 scripts/check-version.py python3 tests/version_test.py - name: Scan Tracked Files and History run: | set -euo pipefail python3 scripts/check-secrets.py --working-tree python3 scripts/check-secrets.py --history guard-submodule-urls: name: Submodule URLs are public HTTPS runs-on: ubuntu-latest steps: # Plain checkout on purpose: the guard must not depend on fetching # the submodules it validates (an SSH URL would break that fetch). - name: Checkout Repository uses: actions/checkout@v4 - name: Reject non-HTTPS submodule URLs run: | set -eu if [ ! -f .gitmodules ]; then echo "no submodules - ok"; exit 0; fi bad=$(grep -nE '^[[:space:]]*url[[:space:]]*=' .gitmodules \ | grep -vE '^[0-9]+:[[:space:]]*url[[:space:]]*=[[:space:]]*https://' || true) if [ -n "$bad" ]; then echo "::error::Non-HTTPS submodule URL(s) break fresh clones and CI:$bad" exit 1 fi echo "all submodule URLs HTTPS - ok" test: name: Test runs-on: ubuntu-latest needs: - guard-submodule-urls - secret-scan timeout-minutes: 60 env: APT_CACHE_DIR: /tmp/apt-cache steps: - name: Checkout Repository uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 1 lfs: true - name: Set up Node.js for Bend proofs uses: actions/setup-node@v4 with: node-version: 22 - name: Cache Test apt packages uses: actions/cache@v4 with: path: ${{ env.APT_CACHE_DIR }} key: test-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/test-packages.txt') }} restore-keys: | test-apt-${{ runner.os }}-${{ runner.arch }}- - name: Install Test Dependencies timeout-minutes: 15 run: .github/scripts/install-apt-packages.sh .github/apt/test-packages.txt - name: Run Tests run: make test - name: Check out sync test server uses: actions/checkout@v4 with: repository: kryonlabs/daochi ref: 902230435fba6f64f5067afab551410456fb57d0 path: .test-server submodules: recursive - name: Set up Go for sync test server uses: actions/setup-go@v5 with: go-version-file: .test-server/go.mod cache-dependency-path: .test-server/go.sum - name: Verify sync and recovery run: | make -C .test-server build make sync-server-test DAOCHI_BIN="$GITHUB_WORKSPACE/.test-server/daochi" build-chrome-extension: name: Build Chrome Extension runs-on: ubuntu-latest timeout-minutes: 60 needs: test env: APT_CACHE_DIR: /tmp/apt-cache steps: - name: Checkout Repository uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 1 lfs: true - name: Set up Node.js for Bend proofs uses: actions/setup-node@v4 with: node-version: 22 - name: Cache Web apt packages uses: actions/cache@v4 with: path: ${{ env.APT_CACHE_DIR }} key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }} restore-keys: | web-apt-${{ runner.os }}-${{ runner.arch }}- - name: Install Web Dependencies timeout-minutes: 15 run: .github/scripts/install-apt-packages.sh .github/apt/web-packages.txt - name: Set up Emscripten run: | set -euo pipefail git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk" "$HOME/emsdk/emsdk" install latest "$HOME/emsdk/emsdk" activate latest echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV" echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV" echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV" echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH" - name: Build Chrome Extension ZIP run: | set -euo pipefail export PATH="$INBE_NODE_BIN:$PATH" node --version make package-unpackaged-assets make chrome-web-store test -f build/dist/inbe-chrome-web-store.zip - name: Run Web Smoke Test run: | set -euo pipefail export PATH="$INBE_NODE_BIN:$PATH" make web-smoke-test - name: Run Canvas Web Smoke Test run: | set -euo pipefail export PATH="$INBE_NODE_BIN:$PATH" make web-canvas make web-canvas-smoke-test build-firefox-addons: name: Build Firefox Add-on runs-on: ubuntu-latest timeout-minutes: 60 needs: test env: APT_CACHE_DIR: /tmp/apt-cache steps: - name: Checkout Repository uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 1 lfs: true - name: Set up Node.js for Bend proofs uses: actions/setup-node@v4 with: node-version: 22 - name: Cache Web apt packages uses: actions/cache@v4 with: path: ${{ env.APT_CACHE_DIR }} key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }} restore-keys: | web-apt-${{ runner.os }}-${{ runner.arch }}- - name: Install Web Dependencies timeout-minutes: 15 run: .github/scripts/install-apt-packages.sh .github/apt/web-packages.txt - name: Set up Emscripten run: | set -euo pipefail git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk" "$HOME/emsdk/emsdk" install latest "$HOME/emsdk/emsdk" activate latest echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV" echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV" echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV" echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH" - name: Build Firefox Add-on ZIP run: | set -euo pipefail export PATH="$INBE_NODE_BIN:$PATH" node --version make package-unpackaged-assets make firefox-addons test -f build/dist/inbe-firefox-addons.zip make firefox-addons-lint - name: Install Firefox (Mozilla build) timeout-minutes: 15 run: | set -euo pipefail .github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt \ xvfb libgl1-mesa-dri libgl1 libegl1 mesa-utils || true .github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt \ libgtk-3-0t64 libx11-xcb1 libxcb-shm0 libasound2t64 libdbus-glib-1-2 \ libxt6t64 libxtst6 libpci3 || \ .github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt \ libgtk-3-0 libx11-xcb1 libxcb-shm0 libasound2 libdbus-glib-1-2 libxt6 libxtst6 libpci3 curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US" \ -o "$HOME/firefox.tar.xz" tar -xJf "$HOME/firefox.tar.xz" -C "$HOME" test -x "$HOME/firefox/firefox" echo "$HOME/firefox" >> "$GITHUB_PATH" - name: Run Web Smoke Test (Firefox) env: LIBGL_ALWAYS_SOFTWARE: '1' run: | set -euo pipefail export PATH="$INBE_NODE_BIN:$PATH" xvfb-run -a --server-args="-screen 0 1280x1024x24" make web-smoke-test-firefox