-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (113 loc) · 3.38 KB
/
pr.yaml
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
---
on:
pull_request:
branches:
- "main"
workflow_dispatch:
env:
XDG_CACHE_HOME: ${{ github.workspace }}/xdg
NODE_MODULES: ${{ github.workspace }}/node_modules
DOT_TERRAFORM: ${{ github.workspace }}/.terraform
TERRAFORM_VERSIONS: ${{ github.workspace }}/.terraform.versions
BUILD_CACHE_ARGS: "--cache-from type=gha --cache-to type=gha,mode=max"
jobs:
changes:
runs-on: ubuntu-latest
outputs:
terraform: ${{ steps.changes.outputs.terraform }}
docker: ${{ steps.changes.outputs.docker }}
prettier: ${{ steps.changes.outputs.prettier }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
terraform:
- 'terraform/**'
- 'docker-lock.json'
- '.github/**'
docker:
- added|modified: '**/*.Dockerfile'
- added|modified: '**/Dockerfile'
- added|modified: '**/docker-compose.yaml'
- added|modified: 'docker-lock.json'
prettier:
- added|modified: '**/*.md'
- added|modified: '**/*.mdx'
- added|modified: '**/*.yaml'
- added|modified: '**/*.js'
- added|modified: '**/*.css'
- added|modified: '**/*.tsx'
- added|modified: '**/*.json'
terraform:
runs-on: ubuntu-latest
needs:
- changes
if: ${{ !always() }} # ${{ needs.changes.outputs.terraform == 'true' }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ${{ env.DOT_TERRAFORM }}
key: ${{ runner.os }}-dot-terraform-${{ hashFiles('terraform/.terraform.lock.hcl') }}
restore-keys: |
${{ runner.os }}-dot-terraform-
- uses: actions/cache@v4
with:
path: ${{ env.TERRAFORM_VERSIONS }}
key: ${{ runner.os }}-terraform-versions-${{ hashFiles('terraform/versions.tf') }}
restore-keys: |
${{ runner.os }}-terraform-versions-
- uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
task terraform:validate TERRAFORM_INIT_ARGS="-backend=false"
docker:
runs-on: ubuntu-latest
needs:
- changes
if: ${{ !always() }} # ${{ needs.changes.outputs.docker == 'true' }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
task validate-images-digests
prettier:
runs-on: ubuntu-latest
needs:
- changes
if: ${{ !always() }} # ${{ needs.changes.outputs.prettier == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ${{ env.NODE_MODULES }}
key: ${{ runner.os }}-prettier-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-prettier-
- uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
task format-check
build:
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- run: exit 0