name: ci on: push: branches: [main] tags: ['v*'] pull_request: jobs: test: runs-on: ubuntu-latest container: rust:1-bookworm steps: - uses: actions/checkout@v4 - run: apt-get update && apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev librsvg2-dev libdbus-1-dev pkg-config - run: cargo test -p knock-core --locked # The oldest supported Ubuntu builds the .deb, so glibc and WebKitGTK fit 22.04 and newer. deb: needs: test if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: ubuntu:22.04 steps: - uses: actions/checkout@v4 - run: | apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y curl build-essential pkg-config file \ libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libdbus-1-dev libssl-dev curl -fsSL https://deb.nodesource.com/setup_22.x | bash - apt-get install -y nodejs curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal - run: | . "$HOME/.cargo/env" npm ci cargo build --release -p knock-cli --locked npx tauri build --bundles deb,rpm,appimage - name: Smoke test on Ubuntu 22.04 run: | apt-get install -y ./target/release/bundle/deb/*.deb xvfb python3 python3 -m http.server 18765 >/dev/null 2>&1 & mkdir -p /tmp/c/environments printf 'version: 1\nname: Smoke\n' > /tmp/c/knock.yaml printf 'name: Root\nurl: http://127.0.0.1:18765/\nassert:\n - { on: status, equals: 200 }\n' > /tmp/c/root.yaml knock run /tmp/c timeout 10 xvfb-run -a knock-app || [ $? -eq 124 ] - uses: actions/upload-artifact@v3 with: name: bundles path: | target/release/bundle/deb/*.deb target/release/bundle/rpm/*.rpm target/release/bundle/appimage/*.AppImage