# Builds and tests the SDK on every push. # # Runner hygiene (shared host, little disk): runs in the runner image that is # already on the host (no image pull), uses no `uses:` actions (no action # cache), and deletes everything it made at the end. name: ci on: push: workflow_dispatch: jobs: test: runs-on: build container: image: docker.gitea.com/runner-images:ubuntu-latest env: CARGO_HOME: /tmp/sf-sdk/cargo RUSTUP_HOME: /tmp/sf-sdk/rustup CARGO_TARGET_DIR: /tmp/sf-sdk/target CARGO_INCREMENTAL: "0" steps: - name: Checkout run: | mkdir -p /tmp/sf-sdk host="${GITHUB_SERVER_URL#https://}" git clone --depth 1 --branch "${GITHUB_REF_NAME}" \ "https://oauth2:${{ secrets.GITHUB_TOKEN }}@${host}/${GITHUB_REPOSITORY}.git" /tmp/sf-sdk/src - name: Toolchain run: | export DEBIAN_FRONTEND=noninteractive apt-get update -qq apt-get install -y -qq --no-install-recommends build-essential pkg-config \ libfontconfig1-dev libfreetype-dev libxkbcommon-dev >/dev/null rm -rf /var/lib/apt/lists/* curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal --no-modify-path - name: Test run: | export PATH="/tmp/sf-sdk/cargo/bin:$PATH" cd /tmp/sf-sdk/src cargo test --locked --workspace - name: Clean up if: always() run: | rm -rf /tmp/sf-sdk df -h / | tail -1