-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 34-support-repositories-with-subdirectory-le…
…an-packages
- Loading branch information
Showing
15 changed files
with
358 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: 'Lake Init Failure Functional Test' | ||
description: 'Run `lean-action` on Lake package generated by `lake init` with a modified `lakefile.lean` to cause a build failure' | ||
runs: | ||
using: 'composite' | ||
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/v3.1.1/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" | ||
shell: bash | ||
|
||
- name: create lake package with `lake init` | ||
run: | | ||
lake init failingpackage | ||
shell: bash | ||
|
||
- name: introduce a syntax error in `lakefile.lean` | ||
run: | | ||
echo "syntax error" >> lakefile.lean | ||
shell: bash | ||
|
||
- name: "run `lean-action`" | ||
id: lean-action | ||
uses: ./ | ||
continue-on-error: true # required so that the action does not fail the workflow | ||
with: | ||
test: false | ||
use-github-cache: false | ||
|
||
- name: verify `lean-action` outcome failure | ||
env: | ||
OUTPUT_NAME: "lean-action outcome" | ||
EXPECTED_VALUE: "failure" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outcome }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash | ||
|
||
- name: verify `lake build` failure | ||
env: | ||
OUTPUT_NAME: "build-status" | ||
EXPECTED_VALUE: "FAILURE" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.build-status }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash | ||
|
||
- name: verify `lake test` didn't run | ||
env: | ||
OUTPUT_NAME: "test-status" | ||
EXPECTED_VALUE: "NOT_RUN" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.test-status }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: 'Lake Init Success Functional Test' | ||
description: 'Run `lean-action` on Lake package generated by `lake init`' | ||
inputs: | ||
lake-init-arguments: | ||
description: 'arguments to pass to `lake init {lake-init-arguments}`' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
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/v3.1.1/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" | ||
shell: bash | ||
|
||
- name: create lake package with `lake init ${{ inputs.lake-init-arguments }}` | ||
run: | | ||
lake init ${{ inputs.lake-init-arguments }} | ||
shell: bash | ||
|
||
- name: "run `lean-action`" | ||
id: lean-action | ||
uses: ./ | ||
with: | ||
test: false | ||
use-github-cache: false | ||
|
||
- name: verify `lean-action` outcome success | ||
env: | ||
OUTPUT_NAME: "lean-action.outcome" | ||
EXPECTED_VALUE: "success" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outcome }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash | ||
|
||
- name: verify `lake build` success | ||
env: | ||
OUTPUT_NAME: "build-status" | ||
EXPECTED_VALUE: "SUCCESS" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.build-status }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash | ||
|
||
- name: verify `lake test` didn't run | ||
env: | ||
OUTPUT_NAME: "test-status" | ||
EXPECTED_VALUE: "NOT_RUN" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.test-status }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: 'Lake Test Failure' | ||
description: 'Run `lean-action` with `lake test` with a failing dummy test_runner' | ||
runs: | ||
using: 'composite' | ||
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/v3.1.1/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" | ||
shell: bash | ||
|
||
- name: create lake package | ||
run: | | ||
lake init dummytest | ||
shell: bash | ||
|
||
- name: create failing dummy test | ||
run: | | ||
{ | ||
echo "@[test_runner]" | ||
echo "script dummy_test do" | ||
echo " println! \"Running fake tests...\"" | ||
echo " println! \"Fake tests failed!\"" | ||
echo " return 1" | ||
} >> lakefile.lean | ||
shell: bash | ||
|
||
- name: "run `lean-action` with `lake test`" | ||
id: lean-action | ||
uses: ./ | ||
continue-on-error: true # required so that the action does not fail the workflow | ||
with: | ||
test: true | ||
use-github-cache: false | ||
|
||
- name: verify `lean-action` outcome failure | ||
env: | ||
OUTPUT_NAME: "lean-action outcome" | ||
EXPECTED_VALUE: "failure" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outcome }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash | ||
|
||
- name: verify `lake build` success | ||
env: | ||
OUTPUT_NAME: "build-status" | ||
EXPECTED_VALUE: "SUCCESS" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.build-status }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash | ||
|
||
- name: verify `lake test` failure | ||
env: | ||
OUTPUT_NAME: "test-status" | ||
EXPECTED_VALUE: "FAILURE" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.test-status }} | ||
run: .github/functional_tests/test_helpers/verify_action_output.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.github/functional_tests/test_helpers/verify_action_output.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Expects the following environment variables to be set in the calling job step: | ||
# - OUTPUT_NAME: the name of the output to verify | ||
# - EXPECTED_VALUE: the expected value of the output | ||
# - ACTUAL_VALUE: the actual value of the output | ||
if [ "$ACTUAL_VALUE" != "$EXPECTED_VALUE" ]; then | ||
echo "Unexpected value for output $OUTPUT_NAME: $ACTUAL_VALUE (expected: $EXPECTED_VALUE)" | ||
exit 1 | ||
fi | ||
echo "Output $OUTPUT_NAME = $EXPECTED_VALUE verified" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.