Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9383201396 |
+223
-19
@@ -1,14 +1,14 @@
|
||||
name: "Test"
|
||||
name: 'Test'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- "README.md"
|
||||
- 'README.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "README.md"
|
||||
- 'README.md'
|
||||
env:
|
||||
# Use docker.io for Docker Hub if empty
|
||||
REGISTRY: ghcr.io
|
||||
@@ -34,20 +34,11 @@ jobs:
|
||||
text: ${{ steps.grep-image-content.outputs.image }}
|
||||
regex: "jekyll-build-pages:(.*)'"
|
||||
|
||||
test-builds:
|
||||
test-simple:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
test:
|
||||
- simple
|
||||
- readme
|
||||
- octicons
|
||||
- mojombo
|
||||
- themes
|
||||
- jekyll-include-cache
|
||||
- future-false
|
||||
- future-true
|
||||
env:
|
||||
TEST_NAME: simple
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
@@ -57,14 +48,227 @@ jobs:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Test ${{ matrix.test }} Project
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ matrix.test }}
|
||||
destination: ./test_projects/${{ matrix.test }}/_site
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{matrix.test}}
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-readme:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_NAME: readme
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-octicons:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_NAME: octicons
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-mojombo:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_NAME: mojombo
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-themes:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_NAME: themes
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-jekyll-include-cache:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_NAME: jekyll-include-cache
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-future-false:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_NAME: future-false
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-future-true:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_NAME: future-true
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
|
||||
- name: Test ${{ env.TEST_NAME }} Project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/${{ env.TEST_NAME }}
|
||||
destination: ./test_projects/${{ env.TEST_NAME }}/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify output
|
||||
run: |
|
||||
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
|
||||
|
||||
test-runner-has-permission:
|
||||
needs: resolve-image-tag
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Build local docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||
- name: Build simple project
|
||||
uses: ./
|
||||
with:
|
||||
source: ./test_projects/simple
|
||||
destination: ./test_projects/simple/_site
|
||||
build_revision: JEKYLL_BUILD_REVISION
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Verify permissions on the build assets
|
||||
run: |
|
||||
if ! [[ -r ./test_projects/simple/_site/index.html ]]; then
|
||||
echo '::error::Read permission is missing' && exit 1
|
||||
fi
|
||||
if ! [[ -w ./test_projects/simple/_site/index.html ]]; then
|
||||
echo '::error::Write permission is missing' && exit 1
|
||||
fi
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user