-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (45 loc) · 1.66 KB
/
Copy pathgenerated.yml
File metadata and controls
57 lines (45 loc) · 1.66 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
name: generated
on:
- push
- pull_request
jobs:
atlas:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Hash migrations
run: mise run migrate_hash
- name: Make sure all changes generated
run: echo 'ci_migration' | mise run migrate_diff
- name: Tidy
run: go mod tidy
- name: Ensure freshly generated hashes match committed ones
# Ignore mise.lock because it seems like mise can't generate checksums for platforms that you aren't on -> always diff
run: |
if ! git diff --exit-code ':!mise.lock'; then
echo "Error: Generating migration hashes again produced output that doesn't match those committed to the repo."
echo "Run 'mise run migrate_hash' and commit the changes."
exit 1
fi
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run generation tasks
run: mise run generate
- name: Tidy
run: go mod tidy
- name: Ensure freshly generated code matches committed code
# Ignore mise.lock because it seems like mise can't generate checksums for platforms that you aren't on -> always diff
run: |
if ! git diff --exit-code ':!mise.lock'; then
echo "Error: Regenerating the generated code produced output that doesn't match the code committed to the repo."
echo "Run 'mise run generate' and commit the changes."
exit 1
fi