-
-
Notifications
You must be signed in to change notification settings - Fork 174
123 lines (110 loc) · 4.23 KB
/
Copy pathscreengrabs.yaml
File metadata and controls
123 lines (110 loc) · 4.23 KB
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
name: Screengrabs
on:
workflow_dispatch:
pull_request:
types: [labeled, opened, synchronize]
paths:
- ".github/workflows/screengrabs.yaml"
- "cmd/terraform/**"
- "internal/exec/**"
- "pkg/provisioner/lock/**"
- "pkg/provisioner/workdir/**"
- "pkg/terraform/cache/**"
- "examples/quick-start-advanced/**"
- "examples/demo-stacks/**"
- "demo/casts/atmos.d/examples/quick-start-advanced/**"
- "demo/casts/atmos.d/screengrabs/demo-stacks/**"
- "demo/casts/cast_checks.py"
permissions:
contents: write
pull-requests: write
env:
TERM: "xterm-256color"
COLORTERM: "truecolor"
LANG: "en_US.UTF-8"
ATMOS_LOGS_LEVEL: "Info"
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Get Atmos version
id: get-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(gh release view --repo cloudposse/atmos --json tagName -q .tagName)
if [ -z "$VERSION" ]; then
echo "Failed to get latest version, using fallback"
VERSION="v1.190.0"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Using Atmos version: $VERSION"
outputs:
version: ${{ steps.get-version.outputs.version }}
build:
needs: [prepare]
runs-on: ubuntu-latest
environment: screengrabs
steps:
- name: Set Git Preferences for windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
# The casts commands build Atmos from this checkout, prepare isolated
# recording fixtures, install declared dependencies, and assert required
# host recorder tools are available.
- name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: go.mod
- name: Build Atmos
run: |
go build -o build/atmos .
echo "$PWD/build" >> "$GITHUB_PATH"
env:
CGO_ENABLED: "0"
- name: Regenerate screengrab casts
run: |
./build/atmos --chdir=demo/casts casts generate screengrabs cli
./build/atmos --chdir=demo/casts casts generate screengrabs demo-stacks
./build/atmos --chdir=demo/casts casts generate examples quick-start-advanced list-instances
./build/atmos --chdir=demo/casts casts validate examples quick-start-advanced list-instances
git add -A
git status
env:
CGO_ENABLED: "0"
ATMOS_PAGER: "false"
# PR-triggered runs only smoke-test the pipeline; the screengrab-update PR
# is created from workflow_dispatch runs on main. Rebasing the update
# commit onto main from a feature branch conflicts when the branch adds or
# removes artifacts that main does not have yet.
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: github-app
if: github.event_name == 'workflow_dispatch'
with:
app-id: ${{ vars.BOT_GITHUB_APP_ID }}
private-key: ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: Create or update PR
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
if: github.event_name == 'workflow_dispatch'
with:
token: ${{ steps.github-app.outputs.token }}
branch: "chore/update-build-screengrabs-for-${{ needs.prepare.outputs.version }}"
title: "Update screengrabs for ${{ needs.prepare.outputs.version }}"
delete-branch: true
sign-commits: true
commit-message: |
chore: update screengrabs for ${{ needs.prepare.outputs.version }}
body: |
This PR updates the screengrabs for Atmos version ${{ needs.prepare.outputs.version }}.
base: main
labels: "no-release"