71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
name: "Test"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "README.md"
|
|
pull_request:
|
|
paths-ignore:
|
|
- "README.md"
|
|
env:
|
|
# Use docker.io for Docker Hub if empty
|
|
REGISTRY: ghcr.io
|
|
# github.repository as <account>/<repo>
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
resolve-image-tag:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tag: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Grep action.yaml content
|
|
id: grep-image-content
|
|
run: |
|
|
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
|
|
echo "::set-output name=image::$image"
|
|
- uses: actions-ecosystem/action-regex-match@v2
|
|
id: regex-match
|
|
with:
|
|
text: ${{ steps.grep-image-content.outputs.image }}
|
|
regex: "jekyll-build-pages:(.*)'"
|
|
|
|
test-builds:
|
|
needs: resolve-image-tag
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
test:
|
|
- simple
|
|
- readme
|
|
- octicons
|
|
- mojombo
|
|
- themes
|
|
- jekyll-include-cache
|
|
- future-false
|
|
- 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 ${{ matrix.test }} Project
|
|
uses: ./
|
|
with:
|
|
source: ./test_projects/${{ matrix.test }}
|
|
destination: ./test_projects/${{ matrix.test }}/_site
|
|
build_revision: JEKYLL_BUILD_REVISION
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Verify output
|
|
run: |
|
|
./bin/compare_expected_output ./test_projects/${{matrix.test}}
|