diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..944cfbc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + name: Build and test + runs-on: ${{ fromJSON(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && '["ubuntu-latest"]' || '["self-hosted","linux","x64","wan0-ci","thistle-tk"]') }} + steps: + - uses: actions/checkout@v6 + + - name: Install native build dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential libsdl2-dev pkg-config + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache Rust builds + uses: Swatinem/rust-cache@v2 + with: + workspaces: | + . -> target + compiler -> target + + - name: Test toolkit + run: cargo test --locked --all-targets + + - name: Test compiler units + run: cargo test --manifest-path compiler/Cargo.toml --locked --lib --bins