forked from defenseunicorns/pepr
-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (137 loc) · 5.12 KB
/
pepr-excellent-examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# name: E2E - Pepr Excellent Examples
# permissions: read-all
# on:
# workflow_dispatch:
# schedule:
# - cron: '0 4 * * *' # 12AM EST/9PM PST
# # refs
# # https://frontside.com/blog/2022-12-12-dynamic-github-action-jobs/
# # https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
# jobs:
# pepr-build:
# name: controller image
# runs-on: ubuntu-latest
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
# with:
# egress-policy: audit
# - name: clone pepr
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# with:
# repository: defenseunicorns/pepr
# path: pepr
# - name: "set env: PEPR"
# run: echo "PEPR=${GITHUB_WORKSPACE}/pepr" >> "$GITHUB_ENV"
# - name: setup node
# uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
# with:
# node-version: 20
# cache: "npm"
# cache-dependency-path: pepr
# - name: install pepr deps
# run: |
# cd "$PEPR"
# npm ci
# - name: build pepr image
# run: |
# cd "$PEPR"
# npm run build:image
# - name: tar pepr image
# run: |
# PEPR_TAR="${GITHUB_WORKSPACE}/pepr-img.tar"
# echo "PEPR_TAR=${PEPR_TAR}" >> "$GITHUB_ENV"
# docker image save --output "$PEPR_TAR" pepr:dev
# - name: upload image tar artifact
# uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
# with:
# name: pepr-img.tar
# path: pepr-img.tar
# retention-days: 1
# examples-matrix:
# name: job matrix
# runs-on: ubuntu-latest
# needs:
# - pepr-build
# outputs:
# matrix: ${{ steps.create-matrix.outputs.matrix }}
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
# with:
# egress-policy: audit
# - name: clone pepr
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# with:
# repository: defenseunicorns/pepr
# path: pepr
# - name: "set env: PEPR"
# run: echo "PEPR=${GITHUB_WORKSPACE}/pepr" >> "$GITHUB_ENV"
# - name: clone pepr-excellent-examples
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# with:
# repository: defenseunicorns/pepr-excellent-examples
# path: pepr-excellent-examples
# - name: "set env: PEXEX"
# run: echo "PEXEX=${GITHUB_WORKSPACE}/pepr-excellent-examples" >> "$GITHUB_ENV"
# - name: setup node
# uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
# with:
# node-version: 20
# cache: "npm"
# cache-dependency-path: pepr
# - name: create matrix
# run: |
# matrix=$(
# node "$PEPR/.github/workflows/pepr-excellent-examples-matrix.js" "$PEXEX"
# )
# echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
# id: create-matrix
# excellent-examples:
# name: ${{ matrix.name }}
# runs-on: ubuntu-latest
# needs:
# - examples-matrix
# if: needs.examples-matrix.outputs.matrix != ''
# strategy:
# fail-fast: false
# max-parallel: 5
# matrix: ${{ fromJSON(needs.examples-matrix.outputs.matrix) }}
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
# with:
# egress-policy: audit
# - name: "install k3d"
# run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash"
# shell: bash
# - name: dowload image tar artifact
# uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
# with:
# name: pepr-img.tar
# path: ${{ github.workspace }}
# - name: import pepr image from tar
# run: |
# PEPR_TAR="${GITHUB_WORKSPACE}/pepr-img.tar"
# echo "PEPR_TAR=${PEPR_TAR}" >> "$GITHUB_ENV"
# docker image load --input "$PEPR_TAR"
# - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# with:
# repository: defenseunicorns/pepr-excellent-examples
# path: pepr-excellent-examples
# - name: "set env: PEXEX"
# run: echo "PEXEX=${GITHUB_WORKSPACE}/pepr-excellent-examples" >> "$GITHUB_ENV"
# - name: setup node
# uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
# with:
# node-version: 20
# cache: "npm"
# cache-dependency-path: pepr-excellent-examples
# - name: install pepr-excellent-examples deps
# run: |
# cd "$PEXEX"
# npm ci
# - name: run e2e tests
# run: |
# cd "$PEXEX"
# npm run --workspace=${{ matrix.name }} test:e2e -- --image pepr:dev