-
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.
The `lint` input functions similarly to the `test` input, allowing the user to run `@[lint_driver]` targets with `lean-action`. Remove the `lint-module` input as users can now use a lint driver to call the Batteries linting framework. Closes #46
- Loading branch information
1 parent
a7937f1
commit b7cdeeb
Showing
10 changed files
with
260 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: 'Lake Lint Failure' | ||
description: 'Run `lean-action` with `lake lint` with a failing dummy lint_driver' | ||
inputs: | ||
toolchain: | ||
description: 'Toolchain to use for the test' | ||
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 ${{ inputs.toolchain }} | ||
echo "$HOME/.elan/bin" >> "$GITHUB_PATH" | ||
shell: bash | ||
|
||
- name: create lake package | ||
run: | | ||
lake init dummylint | ||
shell: bash | ||
|
||
- name: create failing dummy lint driver | ||
run: | | ||
{ | ||
echo "@[lint_driver]" | ||
echo "script dummy_lint do" | ||
echo " println! \"Running fake lint...\"" | ||
echo " println! \"Fake lint failed!\"" | ||
echo " return 1" | ||
} >> lakefile.lean | ||
shell: bash | ||
|
||
- name: "run `lean-action` with `lake lint`" | ||
id: lean-action | ||
uses: ./ | ||
continue-on-error: true # required so that the action does not fail the workflow | ||
with: | ||
lint: 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 lint` failure | ||
env: | ||
OUTPUT_NAME: "lint-status" | ||
EXPECTED_VALUE: "FAILURE" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.lint-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,56 @@ | ||
name: 'Lake Lint Success' | ||
description: 'Run `lean-action` with `lake lint` and a successful dummy lint_driver' | ||
inputs: | ||
toolchain: | ||
description: 'Toolchain to use for the test' | ||
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 ${{ inputs.toolchain }} | ||
echo "$HOME/.elan/bin" >> "$GITHUB_PATH" | ||
shell: bash | ||
|
||
- name: create lake package | ||
run: | | ||
lake init dummylint | ||
shell: bash | ||
|
||
- name: create successful dummy lint | ||
run: | | ||
{ | ||
echo "@[lint_driver]" | ||
echo "script dummy_lint do" | ||
echo " println! \"Running fake lints...\"" | ||
echo " println! \"Fake lints passed!\"" | ||
echo " return 0" | ||
} >> lakefile.lean | ||
shell: bash | ||
|
||
- name: "run `lean-action` with `lake lint`" | ||
id: lean-action | ||
uses: ./ | ||
with: | ||
lint: true | ||
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 lint` success | ||
env: | ||
OUTPUT_NAME: "lint-status" | ||
EXPECTED_VALUE: "SUCCESS" | ||
ACTUAL_VALUE: ${{ steps.lean-action.outputs.lint-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
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.