Skip to content

Commit

Permalink
Add integration tests for absolute output path and --dump (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
mre authored Jan 5, 2024
1 parent 57219e4 commit 37d79d3
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
- pull_request

env:
CUSTOM_OUTPUT_PATH: lychee/custom_output.md
CUSTOM_OUTPUT_RELATIVE_PATH: lychee/custom_output.md
CUSTOM_OUTPUT_ABSOLUTE_PATH: /tmp/report.md
CUSTOM_OUTPUT_DUMP_PATH: /tmp/dump.md

jobs:
lychee-action:
Expand Down Expand Up @@ -50,21 +52,56 @@ jobs:
'./**/*.rst'
fail: true

- name: test custom output path - creation
- name: test custom output relative path - creation
uses: ./
with:
output: "${{ env.CUSTOM_OUTPUT_PATH }}"
output: "${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}"
debug: true

- name: test custom output path - validation
- name: test custom output relative path - validation
run: |
echo "Checking custom output file at ${{ env.CUSTOM_OUTPUT_PATH }}"
if [ ! -f "${{ env.CUSTOM_OUTPUT_PATH }}" ]; then
echo "Checking custom output file at ${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}"
if [ ! -f "${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}" ]; then
echo "Not found"
exit 1
else
echo "Found. Contents:"
cat "${{ env.CUSTOM_OUTPUT_PATH }}"
cat "${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}"
fi
- name: test custom output absolute path - creation
uses: ./
with:
output: "${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}"
debug: true

- name: test custom output absolute path - validation
run: |
echo "Checking custom output file at ${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}"
if [ ! -f "${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}" ]; then
echo "Not found"
exit 1
else
echo "Found. Contents:"
cat "${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}"
fi
- name: test dump with custom output path - creation
uses: ./
with:
args: --dump './**/*.md' './**/*.html' './**/*.rst'
output: "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}"
debug: true

- name: test dump with custom output path - validation
run: |
echo "Checking dump output file at ${{ env.CUSTOM_OUTPUT_DUMP_PATH }}"
if [ ! -f "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}" ]; then
echo "Not found"
exit 1
else
echo "Found. Contents:"
cat "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}"
fi
- name: Install jq
Expand Down

0 comments on commit 37d79d3

Please sign in to comment.