-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
182 lines (128 loc) · 5.38 KB
/
Earthfile
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
VERSION 0.7
COPY_CI_DATA:
COMMAND
COPY --dir "ci/" ".github/" "./"
COPY_METADATA:
COMMAND
DO +COPY_CI_DATA
COPY --dir ".git/" "./"
alpine-base:
FROM alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
# renovate: datasource=repology depName=alpine_3_20/bash versioning=loose
ENV BASH_VERSION="5.2.26-r0"
RUN apk add --no-cache bash=$BASH_VERSION
WORKDIR "/zsh-simple-abbreviations"
check-clean-git-history:
FROM +alpine-base
# renovate: datasource=github-releases depName=DeveloperC286/clean_git_history
ENV CLEAN_GIT_HISTORY_VERSION="v0.2.0"
RUN wget -O - "https://github.com/DeveloperC286/clean_git_history/releases/download/${CLEAN_GIT_HISTORY_VERSION}/x86_64-unknown-linux-musl.gz" | gzip -d > /usr/bin/clean_git_history && chmod 755 /usr/bin/clean_git_history
DO +COPY_METADATA
ARG from_reference="origin/HEAD"
RUN ./ci/check-clean-git-history.sh --from-reference "${from_reference}"
check-conventional-commits-linting:
FROM +alpine-base
# renovate: datasource=github-releases depName=DeveloperC286/conventional_commits_linter
ENV CONVENTIONAL_COMMITS_LINTER_VERSION="v0.14.3"
RUN wget -O - "https://github.com/DeveloperC286/conventional_commits_linter/releases/download/${CONVENTIONAL_COMMITS_LINTER_VERSION}/x86_64-unknown-linux-musl.gz" | gzip -d > /usr/bin/conventional_commits_linter && chmod 755 /usr/bin/conventional_commits_linter
DO +COPY_METADATA
ARG from_reference="origin/HEAD"
RUN ./ci/check-conventional-commits-linting.sh --from-reference "${from_reference}"
COPY_SOURCECODE:
COMMAND
DO +COPY_CI_DATA
COPY --dir "zsh-simple-abbreviations.zsh" "src/" "end-to-end-tests/" "./"
golang-base:
FROM golang:1.22.1
WORKDIR "/zsh-simple-abbreviations"
shell-formatting-base:
FROM +golang-base
# renovate: datasource=github-releases depName=mvdan/sh
ENV SHFMT_VERSION="v3.7.0"
RUN go install mvdan.cc/sh/v3/cmd/shfmt@$SHFMT_VERSION
DO +COPY_SOURCECODE
check-shell-formatting:
FROM +shell-formatting-base
RUN ./ci/check-shell-formatting.sh
yaml-formatting-base:
FROM +golang-base
# renovate: datasource=github-releases depName=google/yamlfmt
ENV YAMLFMT_VERSION="v0.10.0"
RUN go install github.com/google/yamlfmt/cmd/yamlfmt@$YAMLFMT_VERSION
COPY ".yamlfmt" "./"
DO +COPY_CI_DATA
check-yaml-formatting:
FROM +yaml-formatting-base
RUN ./ci/check-yaml-formatting.sh
check-formatting:
BUILD +check-shell-formatting
BUILD +check-yaml-formatting
fix-shell-formatting:
FROM +shell-formatting-base
RUN ./ci/fix-shell-formatting.sh
SAVE ARTIFACT "ci/" AS LOCAL "./"
SAVE ARTIFACT "src/" AS LOCAL "./"
SAVE ARTIFACT "zsh-simple-abbreviations.zsh" AS LOCAL "./"
fix-yaml-formatting:
FROM +yaml-formatting-base
RUN ./ci/fix-yaml-formatting.sh
SAVE ARTIFACT ".github/" AS LOCAL "./"
fix-formatting:
BUILD +fix-shell-formatting
BUILD +fix-yaml-formatting
check-shell-linting:
FROM +alpine-base
# renovate: datasource=repology depName=alpine_3_20/shellcheck versioning=loose
ENV SHELLCHECK_VERSION="0.10.0-r1"
RUN apk add --no-cache shellcheck=$SHELLCHECK_VERSION
DO +COPY_SOURCECODE
RUN ./ci/check-shell-linting.sh
check-github-actions-workflows-linting:
FROM +golang-base
# renovate: datasource=github-releases depName=rhysd/actionlint
ENV ACTIONLINT_VERSION="v1.6.26"
RUN go install github.com/rhysd/actionlint/cmd/actionlint@$ACTIONLINT_VERSION
DO +COPY_CI_DATA
RUN ./ci/check-github-actions-workflows-linting.sh
check-linting:
BUILD +check-shell-linting
BUILD +check-github-actions-workflows-linting
e2e-test:
BUILD +abbreviation-finding-ignores-arguments-e2e-test
BUILD +abbreviation-finding-ignores-environment-variables-e2e-test
BUILD +setting-abbreviation-e2e-test
BUILD +unsetting-abbreviation-e2e-test
BUILD +no-space-does-not-expand-abbreviation-e2e-test
BUILD +no-abbreviations-e2e-test
python-base:
FROM +alpine-base
# renovate: datasource=repology depName=alpine_3_20/python3 versioning=loose
ENV PYTHON_VERSION="3.12.8-r1"
# renovate: datasource=repology depName=alpine_3_20/py3-pip versioning=loose
ENV PIP_VERSION="24.0-r2"
RUN apk add --no-cache py3-pip=$PIP_VERSION python3=$PYTHON_VERSION
e2e-test-base:
FROM +python-base
# renovate: datasource=repology depName=alpine_3_20/zsh versioning=loose
ENV ZSH_VERSION="5.9-r3"
RUN apk add --no-cache zsh=$ZSH_VERSION
DO +COPY_SOURCECODE
RUN pip3 install -r end-to-end-tests/requirements.txt --break-system-packages
abbreviation-finding-ignores-arguments-e2e-test:
FROM +e2e-test-base
RUN python3 end-to-end-tests/abbreviation-finding-ignores-arguments.py
abbreviation-finding-ignores-environment-variables-e2e-test:
FROM +e2e-test-base
RUN python3 end-to-end-tests/abbreviation-finding-ignores-environment-variables.py
setting-abbreviation-e2e-test:
FROM +e2e-test-base
RUN python3 end-to-end-tests/setting-abbreviation.py
unsetting-abbreviation-e2e-test:
FROM +e2e-test-base
RUN python3 end-to-end-tests/unsetting-abbreviation.py
no-space-does-not-expand-abbreviation-e2e-test:
FROM +e2e-test-base
RUN python3 end-to-end-tests/no-space-does-not-expand-abbreviation.py
no-abbreviations-e2e-test:
FROM +e2e-test-base
RUN python3 end-to-end-tests/no-abbreviations.py