Skip to content

Commit d4accba

Browse files
authored
Merge pull request #43 from actions/dependabot/bundler/test_projects/mojombo/tzinfo-1.2.10
Bump tzinfo from 1.2.2 to 1.2.10 in /test_projects/mojombo
2 parents 9b88238 + eaf5f4f commit d4accba

File tree

8 files changed

+125
-19
lines changed

8 files changed

+125
-19
lines changed

bin/record_expected_output

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#! /usr/bin/env sh
22

33
if [ "local" = "$1" ]; then
4-
export JEKYLL_ENV=production
5-
export PAGES_REPO_NWO=actions/jekyll-build-pages
6-
export JEKYLL_BUILD_REVISION=JEKYLL_BUILD_REVISION
4+
export JEKYLL_ENV=production
5+
export PAGES_REPO_NWO=actions/jekyll-build-pages
6+
export JEKYLL_BUILD_REVISION=JEKYLL_BUILD_REVISION
77

8-
for dir in $(ls test_projects)
9-
do
10-
bundle exec github-pages build --verbose -s test_projects/$dir -d test_projects/$dir/_expected
11-
done
8+
for dir in $(ls test_projects)
9+
do
10+
bundle exec github-pages build --verbose -s test_projects/$dir -d test_projects/$dir/_expected
11+
done
1212
else
13-
act -b -s GITHUB_TOKEN -j record-expected-output
13+
act -b -s GITHUB_TOKEN -j record-expected-output
1414
fi

bin/sync_expected_output.ps1

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env pwsh
2+
#Requires -Version 7.2
3+
4+
<#
5+
.SYNOPSIS
6+
Trigger the workflow that records the tests expected outputs, wait for its execution to finish,
7+
then bring back those results locally.
8+
9+
.DESCRIPTION
10+
This script is meant to run locally outside of Actions. It relies on `gh` and `git`.
11+
#>
12+
13+
# Get the repository's path (ps1 extension on the script is required for PSScriptRoot to be available 🤦)
14+
$repositoryPath = Resolve-Path (Join-Path $PSScriptRoot '..')
15+
16+
# Get the test_project's path
17+
$testProjectsPath = Resolve-Path (Join-Path $PSScriptRoot '../test_projects')
18+
19+
#
20+
# Utilities
21+
#
22+
23+
# Run a command and validate it returned a 0 exit code
24+
function Invoke-Command {
25+
param (
26+
[ScriptBlock] $Command
27+
)
28+
29+
& $Command
30+
if ($LASTEXITCODE -ne 0) {
31+
Write-Error "Command failed: $Command"
32+
throw
33+
}
34+
}
35+
36+
# Get the current git ref name
37+
function Get-GitRef {
38+
$commitId = Invoke-Command { & git -C $repositoryPath rev-parse --abbrev-ref HEAD }
39+
$commitId.Trim()
40+
}
41+
42+
# Create a temp folder and return its path
43+
function New-TemporaryFolder {
44+
$path = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid())
45+
New-Item -ItemType 'Directory' -Path $path | Out-Null
46+
$path
47+
}
48+
49+
#
50+
# Main
51+
#
52+
53+
# Init
54+
Set-StrictMode -version 'Latest'
55+
$ErrorActionPreference = 'Stop'
56+
57+
# Get git ref name
58+
$ref = Get-GitRef
59+
60+
# Run the workflow
61+
Write-Host 'Queue workflow'
62+
$workflow = 'record.yml'
63+
Invoke-Command { & gh workflow run $workflow --ref $ref | Out-Null }
64+
65+
# Wait for a few seconds for the workflow to get created
66+
Write-Host 'Wait a few seconds...'
67+
Start-Sleep -Seconds 5
68+
69+
# Lookup the run id (it is not perfect because of the APIs...)
70+
Write-Host 'Lookup run id'
71+
$runId = Invoke-Command { & gh run list --workflow $workflow --branch $ref --limit 1 --json databaseId --jq '.[].databaseId' }
72+
73+
# Wait for the workflow to finish
74+
Write-Host "Wait for workflow $runId to complete"
75+
Invoke-Command { & gh run watch $runId --exit-status }
76+
77+
# Download the artifacts in a temp folder
78+
Write-Host 'Download artifacts'
79+
$tempFolder = New-TemporaryFolder
80+
Invoke-Command { & gh run download $runId --dir $tempFolder }
81+
82+
# Iterate over the test projects
83+
Get-ChildItem -Path $testProjectsPath -Directory | ForEach-Object {
84+
# Construct the artifact path and make sure a matching artifact is found
85+
$artifactPath = Join-Path $tempFolder $_.BaseName
86+
if (Test-Path $artifactPath -PathType 'Container') {
87+
# Copy artifact to the expected output folder
88+
$destinationPath = Join-Path $testProjectsPath $_.BaseName '_expected'
89+
Copy-Item -Path (Join-Path $artifactPath '*') -Destination $destinationPath -Recurse -Force | Out-Null
90+
}
91+
92+
# Ignore test project
93+
else {
94+
Write-Warning "Unable to find artifact for test project $($_.BaseName)"
95+
}
96+
}

test_projects/jekyll-include-cache/_expected/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

88
<!-- Begin Jekyll SEO tag v2.8.0 -->
9-
<title>jekyll-build-pages</title>
9+
<title>jekyll-build-pages | A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</title>
1010
<meta name="generator" content="Jekyll v3.9.2" />
1111
<meta property="og:title" content="jekyll-build-pages" />
1212
<meta property="og:locale" content="en_US" />
13+
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
14+
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
1315
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
1416
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
1517
<meta property="og:site_name" content="jekyll-build-pages" />
1618
<meta property="og:type" content="website" />
1719
<meta name="twitter:card" content="summary" />
1820
<meta property="twitter:title" content="jekyll-build-pages" />
1921
<script type="application/ld+json">
20-
{"@context":"https://schema.org","@type":"WebSite","headline":"jekyll-build-pages","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
22+
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"jekyll-build-pages","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
2123
<!-- End Jekyll SEO tag -->
2224

2325
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">

test_projects/mojombo/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ GEM
128128
faraday (~> 0.8, < 0.10)
129129
terminal-table (1.7.3)
130130
unicode-display_width (~> 1.1.1)
131-
thread_safe (0.3.5)
131+
thread_safe (0.3.6)
132132
typhoeus (0.8.0)
133133
ethon (>= 0.8.0)
134-
tzinfo (1.2.2)
134+
tzinfo (1.2.10)
135135
thread_safe (~> 0.1)
136136
unicode-display_width (1.1.1)
137137

test_projects/octicons/_expected/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
<meta name="generator" content="Jekyll v3.9.2" />
1111
<meta property="og:title" content="Readme Test" />
1212
<meta property="og:locale" content="en_US" />
13+
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
14+
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
1315
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
1416
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
1517
<meta property="og:site_name" content="jekyll-build-pages" />
1618
<meta property="og:type" content="website" />
1719
<meta name="twitter:card" content="summary" />
1820
<meta property="twitter:title" content="Readme Test" />
1921
<script type="application/ld+json">
20-
{"@context":"https://schema.org","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
22+
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
2123
<!-- End Jekyll SEO tag -->
2224

2325
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">

test_projects/readme/_expected/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
<meta name="generator" content="Jekyll v3.9.2" />
1111
<meta property="og:title" content="Readme Test" />
1212
<meta property="og:locale" content="en_US" />
13+
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
14+
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
1315
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
1416
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
1517
<meta property="og:site_name" content="jekyll-build-pages" />
1618
<meta property="og:type" content="website" />
1719
<meta name="twitter:card" content="summary" />
1820
<meta property="twitter:title" content="Readme Test" />
1921
<script type="application/ld+json">
20-
{"@context":"https://schema.org","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
22+
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
2123
<!-- End Jekyll SEO tag -->
2224

2325
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">

test_projects/simple/_expected/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

88
<!-- Begin Jekyll SEO tag v2.8.0 -->
9-
<title>Jekyll Actions Demo</title>
9+
<title>Jekyll Actions Demo | A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</title>
1010
<meta name="generator" content="Jekyll v3.9.2" />
1111
<meta property="og:title" content="Jekyll Actions Demo" />
1212
<meta property="og:locale" content="en_US" />
13+
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
14+
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
1315
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
1416
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
1517
<meta property="og:site_name" content="Jekyll Actions Demo" />
1618
<meta property="og:type" content="website" />
1719
<meta name="twitter:card" content="summary" />
1820
<meta property="twitter:title" content="Jekyll Actions Demo" />
1921
<script type="application/ld+json">
20-
{"@context":"https://schema.org","@type":"WebSite","headline":"Jekyll Actions Demo","name":"Jekyll Actions Demo","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
22+
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"Jekyll Actions Demo","name":"Jekyll Actions Demo","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
2123
<!-- End Jekyll SEO tag -->
2224

2325
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">

test_projects/themes/_expected/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

88
<!-- Begin Jekyll SEO tag v2.8.0 -->
9-
<title>themes</title>
9+
<title>themes | A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</title>
1010
<meta name="generator" content="Jekyll v3.9.2" />
1111
<meta property="og:title" content="themes" />
1212
<meta property="og:locale" content="en_US" />
13+
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
14+
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
1315
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
1416
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
1517
<meta property="og:site_name" content="themes" />
1618
<meta property="og:type" content="website" />
1719
<meta name="twitter:card" content="summary" />
1820
<meta property="twitter:title" content="themes" />
1921
<script type="application/ld+json">
20-
{"@context":"https://schema.org","@type":"WebSite","headline":"themes","name":"themes","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
22+
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"themes","name":"themes","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
2123
<!-- End Jekyll SEO tag -->
2224

2325
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -43,7 +45,7 @@ <h1><a href="https://github.com/pages/actions/jekyll-build-pages/">themes</a></h
4345

4446

4547

46-
<p></p>
48+
<p>A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</p>
4749

4850

4951
<p class="view"><a href="https://github.com/actions/jekyll-build-pages">View the Project on GitHub <small>actions/jekyll-build-pages</small></a></p>

0 commit comments

Comments
 (0)