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

Add integration tests for absolute output path and --dump #218

Merged
merged 1 commit into from
Jan 5, 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
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