Compare commits

..

1 Commits

Author SHA1 Message Date
Yoann Chaudet 9383201396 Add a test to validate read/write permissions 2022-02-07 18:47:45 -08:00
11 changed files with 241 additions and 42 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
with:
version: v0.8.0
format: tty
+223 -19
View File
@@ -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
+1 -1
View File
@@ -5,7 +5,7 @@ source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# Manage our dependency on the version of the github-pages gem here.
gem "github-pages", "= 225"
gem "github-pages", "= 223"
# Explicitly include this gem here.
# It is not directly included in the github-pages gem list of dependencies,
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>The Future is Looking Bright! | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="The Future is Looking Bright!" />
@@ -20,7 +20,7 @@
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="The Future is Looking Bright!" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","description":"Everythings coming up Milhouse.","headline":"The Future is Looking Bright!","mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"}</script>
{"mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"description":"Everythings coming up Milhouse.","url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html","@type":"BlogPosting","headline":"The Future is Looking Bright!","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>The Future is Looking Bright! | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="The Future is Looking Bright!" />
@@ -20,7 +20,7 @@
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="The Future is Looking Bright!" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","description":"Everythings coming up Milhouse.","headline":"The Future is Looking Bright!","mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"}</script>
{"mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"description":"Everythings coming up Milhouse.","url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html","@type":"BlogPosting","headline":"The Future is Looking Bright!","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>We Live In Hell | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="We Live In Hell" />
@@ -20,7 +20,7 @@
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="We Live In Hell" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2022-03-01T00:00:00-05:00","datePublished":"2022-03-01T00:00:00-05:00","description":"And its not even the cool hell that [redacted] are afraid of. 😭","headline":"We Live In Hell","mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html"},"url":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html"}</script>
{"mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html"},"description":"And its not even the cool hell that [redacted] are afraid of. 😭","url":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html","@type":"BlogPosting","headline":"We Live In Hell","dateModified":"2022-03-01T00:00:00-05:00","datePublished":"2022-03-01T00:00:00-05:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="jekyll-build-pages" />
@@ -13,11 +13,10 @@
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="jekyll-build-pages" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="jekyll-build-pages" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","headline":"jekyll-build-pages","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"headline":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","name":"jekyll-build-pages","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
+2 -3
View File
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Readme Test | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Readme Test" />
@@ -13,11 +13,10 @@
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="jekyll-build-pages" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Readme Test" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
+2 -3
View File
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Readme Test | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Readme Test" />
@@ -13,11 +13,10 @@
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="jekyll-build-pages" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Readme Test" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
+2 -3
View File
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Jekyll Actions Demo</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Jekyll Actions Demo" />
@@ -13,11 +13,10 @@
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="Jekyll Actions Demo" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Jekyll Actions Demo" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","headline":"Jekyll Actions Demo","name":"Jekyll Actions Demo","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"Jekyll Actions Demo","name":"Jekyll Actions Demo","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
+2 -3
View File
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>themes</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="themes" />
@@ -13,11 +13,10 @@
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="themes" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="themes" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","headline":"themes","name":"themes","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"themes","name":"themes","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">