Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Test build only
Browse files Browse the repository at this point in the history
  • Loading branch information
helaili committed Jan 3, 2021
2 parents 21bf6f1 + 12fd510 commit 91dcb26
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 2 deletions.
71 changes: 69 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
with:
jekyll_build_options: "--config ../sample_site/_config.yml,../sample_site/_config_basic.yml"
jekyll_env: development
build_only: false
env:
JEKYLL_PAT: ${{ secrets.JEKYLL_PAT }}

Expand Down Expand Up @@ -136,7 +137,6 @@ jobs:
with:
name: cypress-screenshots-${{ runner.os }}-${{ matrix.node-version }}
path: tests/e2e/screenshots
# Test run video was always captured, so this action uses "always()" condition
- name: Save Cypress Videos
uses: actions/upload-artifact@v2
if: always()
Expand Down Expand Up @@ -205,10 +205,77 @@ jobs:
with:
name: cypress-screenshots-${{ runner.os }}-${{ matrix.node-version }}
path: tests/e2e/screenshots
# Test run video was always captured, so this action uses "always()" condition
- name: Save Cypress Videos
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos-${{ runner.os }}-${{ matrix.node-version }}
path: tests/e2e/videos

build-only-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: sample_site_gemfiles/vendor/bundle
key: gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
gems
- name: Basic run
uses: ./
with:
jekyll_build_options: "--config ../sample_site/_config.yml,../sample_site/_config_build_only.yml"
jekyll_env: development
build_only: true
env:
JEKYLL_PAT: ${{ secrets.JEKYLL_PAT }}

build-only-test:
runs-on: ubuntu-latest
needs: jekyll-gem-src-test
steps:
- name: Set the GH Pages branch
uses: actions/github-script@v3
with:
github-token: ${{secrets.JEKYLL_PAT}}
script: |
await github.repos.updateInformationAboutPagesSite({
owner: context.repo.owner,
repo: context.repo.repo,
source: {
branch: "jekyll_gem_src_test_pages_branch",
path: "/"
}
})
await github.repos.requestPagesBuild({
owner: context.repo.owner,
repo: context.repo.repo
})
- uses: actions/checkout@v2
- name: Caching
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cypress run
uses: cypress-io/github-action@v2.7.2
with:
config: baseUrl=https://helaili.github.io
working-directory: tests/e2e
# We're not publishing so the previous test should still pass
spec: cypress/integration/jekyll_gem_src/**/*
- name: Save Cypress Screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots-${{ runner.os }}-${{ matrix.node-version }}
path: tests/e2e/screenshots
- name: Save Cypress Videos
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos-${{ runner.os }}-${{ matrix.node-version }}
path: tests/e2e/videos
2 changes: 2 additions & 0 deletions sample_site/_config_build_only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: Jekyll AsciiDoc Action - Build Only
test_id: build_only

0 comments on commit 91dcb26

Please sign in to comment.