@@ -2,67 +2,67 @@ name: Record Expected
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ pull_request :
6
+
7
+ env :
8
+ # Use docker.io for Docker Hub if empty
9
+ REGISTRY : ghcr.io
10
+ # github.repository as <account>/<repo>
11
+ IMAGE_NAME : ${{ github.repository }}
5
12
6
13
jobs :
7
- record-expected-output :
14
+ resolve-image-tag :
8
15
runs-on : ubuntu-latest
16
+ outputs :
17
+ tag : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}
9
18
steps :
10
19
- name : Checkout repository
11
20
uses : actions/checkout@v2
12
-
13
- - name : Build test project 'simple'
14
- uses : ./
15
- with :
16
- source : test_projects/simple
17
- destination : test_projects/simple/_expected
18
- build_revision : JEKYLL_BUILD_REVISION
19
-
20
- - name : Build test project 'readme'
21
- uses : ./
21
+ - name : Grep action.yaml content
22
+ id : grep-image-content
23
+ run : |
24
+ image=$(grep -E "jekyll-build-pages.*\'" action.yml)
25
+ echo "::set-output name=image::$image"
26
+ - uses : actions-ecosystem/action-regex-match@v2
27
+ id : regex-match
22
28
with :
23
- source : test_projects/readme
24
- destination : test_projects/readme/_expected
25
- build_revision : JEKYLL_BUILD_REVISION
29
+ text : ${{ steps.grep-image-content.outputs.image }}
30
+ regex : " jekyll-build-pages:(.*)'"
26
31
27
- - name : Build test project 'octicons'
28
- uses : ./
29
- with :
30
- source : test_projects/octicons
31
- destination : test_projects/octicons/_expected
32
- build_revision : JEKYLL_BUILD_REVISION
33
-
34
- - name : Build test project 'mojombo'
35
- uses : ./
36
- with :
37
- source : test_projects/mojombo
38
- destination : test_projects/mojombo/_expected
39
- build_revision : JEKYLL_BUILD_REVISION
40
-
41
- - name : Build test project 'themes'
42
- uses : ./
43
- with :
44
- source : test_projects/themes
45
- destination : test_projects/themes/_expected
46
- build_revision : JEKYLL_BUILD_REVISION
47
-
48
- - name : Build test project 'jekyll-include-cache'
49
- uses : ./
32
+ test-builds :
33
+ needs : resolve-image-tag
34
+ runs-on : ubuntu-latest
35
+ strategy :
36
+ matrix :
37
+ test :
38
+ - simple
39
+ - readme
40
+ - octicons
41
+ - mojombo
42
+ - themes
43
+ - jekyll-include-cache
44
+ - future-false
45
+ - future-true
46
+ steps :
47
+ - name : Checkout repository
48
+ uses : actions/checkout@v2
49
+ - name : Build local docker image
50
+ uses : docker/build-push-action@v2
50
51
with :
51
- source : test_projects/jekyll-include-cache
52
- destination : test_projects/jekyll-include-cache/_expected
53
- build_revision : JEKYLL_BUILD_REVISION
52
+ context : .
53
+ file : Dockerfile
54
+ tags : ${{ needs.resolve-image-tag.outputs.tag }}
54
55
55
- - name : Build test project 'future-false'
56
+ - name : Build ${{ matrix. test }} Project
56
57
uses : ./
57
58
with :
58
- source : test_projects/future-false
59
- destination : test_projects/future-false /_expected
59
+ source : ./ test_projects/${{ matrix.test }}
60
+ destination : ./ test_projects/${{ matrix.test }} /_expected
60
61
build_revision : JEKYLL_BUILD_REVISION
62
+ token : ${{ secrets.GITHUB_TOKEN }}
61
63
62
- - name : Build test project 'future-true'
63
- uses : ./
64
+ - name : Archive ${{ matrix. test }} Project
65
+ uses : actions/upload-artifact@v3
64
66
with :
65
- source : test_projects/future-true
66
- destination : test_projects/future-true/_expected
67
- build_revision : JEKYLL_BUILD_REVISION
68
-
67
+ name : ${{ matrix.test }}
68
+ path : ./test_projects/${{ matrix.test }}/_expected
0 commit comments