diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61cfc52..3705eb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,20 +5,49 @@ on: name: CI jobs: - update_lean_xyz_branch_and_build: - runs-on: ubuntu-latest - name: Update lean-x.y.z branch and build project + build: + strategy: + matrix: + include: + - name: Linux + os: ubuntu-latest + - name: Windows + os: windows-latest + - name: macOS + os: macos-latest + + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v3 + + - name: Setup elan toolchain on Linux or macOS + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: | + curl -O --location https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh + chmod u+x elan-init.sh + ./elan-init.sh -y --default-toolchain leanprover/lean4:nightly + echo "Adding location $HOME/.elan/bin to PATH..." + echo "$HOME/.elan/bin" >> $GITHUB_PATH - - name: checkout project - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: Setup elan toolchain on Windows + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + curl -O --location https://raw.githubusercontent.com/leanprover/elan/master/elan-init.ps1 + .\elan-init.ps1 -NoPrompt 1 -DefaultToolchain leanprover/lean4:nightly + echo "Adding location $HOME\.elan\bin to PATH..." + echo "$HOME\.elan\bin" >> $env:GITHUB_PATH - - name: update branch - if: github.ref == 'refs/heads/master' - uses: leanprover-contrib/update-versions-action@master + - name: Test elan & lean are working + run: | + elan --version + lean --version - - name: build project - uses: leanprover-contrib/lean-build-action@master + - name: Build everything + run: | + lake build + - name: Run the test + run: | + lake exe test