Skip to content

Commit

Permalink
Merge pull request leanprover-community#23 from goens/CI
Browse files Browse the repository at this point in the history
Add CI
  • Loading branch information
marcusrossel authored Feb 28, 2024
2 parents 5b20019 + 0bff386 commit 541c57d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build & test
on:
push:
branches:
- "main"
pull_request:
merge_group:

permissions:
contents: write

jobs:
build:
name: build and test code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install elan
run: |
set -o pipefail
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain none -y
~/.elan/bin/lean --version
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: Compile Library
run: |
lake build
- name: Run Tests
run: |
cd Lean/Egg/Tests && ./run_tests.sh
26 changes: 21 additions & 5 deletions Lean/Egg/Tests/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/bash
#!/usr/bin/env bash

tests_dir="$(realpath -s "$(dirname "$0")")"
pkg_dir="${tests_dir}/../../.."
module_prefix="Egg.Tests."
expected_fail="WIP"

cd "$pkg_dir"

status=0

for file in "$tests_dir"/*; do
if [[ -f "$file" ]]; then
if [[ "$file" == *".lean" ]]; then
Expand All @@ -17,13 +20,26 @@ for file in "$tests_dir"/*; do

if [[ $? -eq 0 ]]; then
if grep -q "sorry" "$file"; then
echo -e "\r🟡 ${file_name} "
echo -e "\r🟡 ${file_name} "
else
echo -e "\r✅ ${file_name} "
echo -e "\r✅ ${file_name} "
fi
else
echo -e "\r❌ ${file_name} "
expected=0
for name in $expected_fail; do
if [ "$name" = "$file_name" ]; then
expected=1
echo -e "\r❌ ${file_name} (expected)"
break
fi
done
if [[ $expected -eq 0 ]]; then
echo -e "\r❌ ${file_name} "
status=1
fi
fi
fi
fi
done
done

exit $status

0 comments on commit 541c57d

Please sign in to comment.