Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add workflow to run basic functional tests #35

Merged
merged 5 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/functional_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Functional Tests

on:
pull_request:
branches: [main]
paths:
- "scripts/**"
- "action.yml"
- ".github/workflows/functional_tests.yml"
workflow_dispatch:

jobs:
no-lake-test:
runs-on: ubuntu-latest
strategy:
matrix:
# run with and without `lake test'
lake-test: ["true", "false"]
# run for standalone package and one which depends on mathlib
lake-init-command: ["init standalone", "init mathdep math"]
steps:
# TODO: once `lean-action` supports just setup use it here
- name: install elan
run: |
set -o pipefail
curl -sSfL https://github.com/leanprover/elan/releases/download/v1.4.2/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
./elan-init -y --default-toolchain leanprover/lean4:v4.8.0-rc1
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"

- uses: actions/checkout@v4

- name: create standalone project
run: |
lake ${{ matrix.lake-init-command }}
ls

- name: create dummy test
if: ${{ matrix.lake-test == 'true' }}
run: |
{
echo "@[test_runner]"
echo "script dummy_test do"
echo " println! \"Running fake tests...\""
echo " println! \"Fake tests passed!\""
echo " return 0"
} >> lakefile.lean

- name: ls and pwd
run: |
ls
pwd

- name: "run `lean-action` with on `lake ${{matrix.lake-init-command}}` with test: ${{ matrix.lake-test }}"
uses: ./
with:
test: ${{ matrix.lake-test }}
Loading