Skip to content
Open
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions .github/workflows/pelican-version-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,86 +8,85 @@
workflow_dispatch:
jobs:
version-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- gfm: 'true'
testbranch: testsite
buildshouldfail: false
- gfm: 'true'
testbranch: testsite
gfm_version: '0.28.3.gfm.12' # This is the earliest that will build
buildshouldfail: false
- gfm: 'true'
testbranch: testsite
gfm_version: '0.29.0.gfm.13' # latest
buildshouldfail: false
- gfm: 'false'
testbranch: testsitenogfm
buildshouldfail: false
- gfm: 'false'
testbranch: testsitenogfm
gfm_version: 'not-a-version'
buildshouldfail: false
- gfm: 'true'
testbranch: testsite
gfm_version: 'not-a-version'
buildshouldfail: true # Try to build a non-existent version
- gfm: 'true'
testbranch: testsite
gfm_version: '0.28.0.gfm.11'
buildshouldfail: true # Try to build an obsolete version
steps:
- name: Checkout the test site
uses: actions/checkout@v4
with:
ref: ${{ matrix.testbranch }}
- name: Ignore the action checkout
run: |
echo "self/" >> .git/info/exclude
- name: Checkout self
uses: actions/checkout@v4
with:
path: self

- name: Build (no publish)
id: build
continue-on-error: ${{ matrix.buildshouldfail }}
uses: ./self/pelican
with:
destination: output
publish: 'false'
tempdir: output
gfm: ${{ matrix.gfm }}
gfm_version: ${{ matrix.gfm_version }}
env:
UNIT_TEST_A: This is UNIT_TEST_A

- name: Check build failed when expected
if: ${{ matrix.buildshouldfail }}
run: |
echo "${{ toJSON(steps.build) }}"
test '${{ steps.build.outcome }}' != 'success'

- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: build-output-${{ matrix.gfm }}-${{ matrix.gfm_version }}
path: output
retention-days: 1

- name: Check output
if: ${{ steps.build.outcome == 'success' }}
run: |
test -f output/index.html # check output was created
if [ '${{ matrix.gfm }}' == 'true' ]
then
# Check that GFM was used
grep '<p><del>Hi</del> Hello, <del>there</del> world!</p>' output/index.html
else
# Check that GFM was NOT used
! grep '<p><del>Hi</del> Hello, <del>there</del> world!</p>' output/index.html
fi

fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't work completely, sorry. Please just fix it so there's a newline at the end of the file.

Loading