File tree 4 files changed +49
-1
lines changed
4 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 17
17
uses : actions/checkout@v3
18
18
- name : Check GitHub Actions workflows linting.
19
19
run : earthly +check-github-actions-workflows-linting
20
+ formatting :
21
+ name : Formatting
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - name : Download Earthly v0.8.6.
25
+ run : " sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
26
+ - name : Checkout code.
27
+ uses : actions/checkout@v3
28
+ - name : Check formatting.
29
+ run : earthly +check-yaml-formatting
Original file line number Diff line number Diff line change @@ -33,8 +33,34 @@ check-conventional-commits-linting:
33
33
RUN ./ci/check-conventional-commits-linting.sh --from-reference "${from_reference}"
34
34
35
35
36
- check-github-actions-workflows-linting :
36
+ golang-base :
37
37
FROM golang:1.20.13
38
+ ENV GOPROXY= direct
39
+ ENV CGO_ENABLED= 0
40
+ ENV GOOS= linux
41
+ ENV GOARCH= amd64
42
+
43
+
44
+ yaml-formatting-base :
45
+ FROM +golang-base
46
+ RUN go install github.com/google/yamlfmt/cmd/yamlfmt@v0.10.0
47
+ COPY ".yamlfmt" "./"
48
+ DO +COPY_CI_DATA
49
+
50
+
51
+ check-yaml-formatting :
52
+ FROM +yaml-formatting-base
53
+ RUN ./ci/check-yaml-formatting.sh
54
+
55
+
56
+ fix-yaml-formatting :
57
+ FROM +yaml-formatting-base
58
+ RUN ./ci/fix-yaml-formatting.sh
59
+ SAVE ARTIFACT ".github/" AS LOCAL "./"
60
+
61
+
62
+ check-github-actions-workflows-linting :
63
+ FROM +golang-base
38
64
RUN go install github.com/rhysd/actionlint/cmd/actionlint@v1.6.26
39
65
DO +COPY_CI_DATA
40
66
RUN ./ci/check-github-actions-workflows-linting.sh
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -o errexit
4
+ set -o xtrace
5
+
6
+ yamlfmt -lint -dstar .github/** /*
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ set -o errexit
4
+ set -o xtrace
5
+
6
+ yamlfmt -dstar ./github/** /*
You can’t perform that action at this time.
0 commit comments