Skip to content

Commit 86d9a23

Browse files
authored
build: unify macos/windows yamls (runfinch#921)
Issue #, if available: *Description of changes:* To avoid issues where properties that are supposed to be the same (e.g. the nerdctl-full archive) end up mismatched, I've introduced a way to build our YAML files from a common source using [yq ](https://github.com/mikefarah/yq) This won't work on Windows until this is merged to install yq on the Windows runners runfinch/infrastructure#594 *Testing done:* - Local testing - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Justin Alvarez <[email protected]>
1 parent fd7c61d commit 86d9a23

12 files changed

+152
-397
lines changed

Diff for: .github/workflows/benchmark.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
fi
4848
- name: Install Rosetta 2
4949
run: echo "A" | softwareupdate --install-rosetta || true
50-
- run: brew install go lz4 automake autoconf libtool
50+
- run: brew install go lz4 automake autoconf libtool yq
5151
shell: zsh {0}
5252
- name: Build project
5353
run: |

Diff for: .github/workflows/build-and-test-pkg.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
cache: true
5454
- name: Make macos aarch64 build
5555
run: |
56-
brew install lz4 automake autoconf libtool
56+
brew install lz4 automake autoconf libtool yq
5757
git status
5858
git clean -f -d
5959
make clean
@@ -91,7 +91,7 @@ jobs:
9191

9292
- name: Make macos x86_64 build
9393
run: |
94-
brew install lz4 automake autoconf libtool
94+
brew install lz4 automake autoconf libtool yq
9595
git status
9696
git clean -f -d
9797
make clean
@@ -166,7 +166,7 @@ jobs:
166166
run: echo "A" | softwareupdate --install-rosetta || true
167167
- name: Build project
168168
run: |
169-
brew install lz4 automake autoconf libtool
169+
brew install lz4 automake autoconf libtool yq
170170
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
171171
make
172172
shell: zsh {0}
@@ -287,7 +287,7 @@ jobs:
287287
run: echo "A" | softwareupdate --install-rosetta || true
288288
- name: Build project
289289
run: |
290-
brew install lz4 automake autoconf libtool
290+
brew install lz4 automake autoconf libtool yq
291291
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
292292
make
293293
shell: zsh {0}

Diff for: .github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
fi
191191
- name: Install Rosetta 2
192192
run: echo "A" | softwareupdate --install-rosetta || true
193-
- run: brew install lz4 automake autoconf libtool
193+
- run: brew install lz4 automake autoconf libtool yq
194194
shell: zsh {0}
195195
- name: Build project
196196
run: |

Diff for: .github/workflows/release-homebrew.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
run: echo "A" | softwareupdate --install-rosetta || true
100100
- name: Build project
101101
run: |
102-
brew install lz4 automake autoconf libtool
102+
brew install lz4 automake autoconf libtool yq
103103
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
104104
make
105105
shell: zsh {0}
@@ -220,7 +220,7 @@ jobs:
220220
run: echo "A" | softwareupdate --install-rosetta || true
221221
- name: Build project
222222
run: |
223-
brew install lz4 automake autoconf libtool
223+
brew install lz4 automake autoconf libtool yq
224224
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
225225
make
226226
shell: zsh {0}

Diff for: .github/workflows/upload-build-to-S3.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
cache: true
2828
- name: Make macos aarch64 build
2929
run: |
30-
brew install lz4 automake autoconf libtool
30+
brew install lz4 automake autoconf libtool yq
3131
make clean
3232
make download-licenses
3333
make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch
@@ -56,7 +56,7 @@ jobs:
5656
cache: true
5757
- name: Make macos x86_64 build
5858
run: |
59-
brew install lz4 automake autoconf libtool
59+
brew install lz4 automake autoconf libtool yq
6060
make clean
6161
make download-licenses
6262
make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ For more details, see [`.golangci.yaml`](./.golangci.yaml) and the `lint` target
117117
Before building, install dependencies required to build the project binaries.
118118

119119
```sh
120-
brew install go lz4 automake autoconf libtool
120+
brew install go lz4 automake autoconf libtool yq
121121
```
122122

123123
Note that you may need to add the following to the `.profile` file of your shell if `which libtool` does not return the one installed by Homebrew. The one that comes with macOS is too old for our use.

Diff for: Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ endif
143143
.PHONY: finch.yaml
144144
finch.yaml: finch-core
145145
mkdir -p $(OUTDIR)/os
146+
# merge the appropriate YAMLs
147+
cd finch.yaml.d && yq eval-all '. as $$item ireduce ({}; . *+ $$item)' mac.yaml common.yaml > ../finch.yaml
146148
cp finch.yaml $(OUTDIR)/os
147149
# using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed
148150
# this sed command uses the alternative separator of "|" because the image location uses "/"
@@ -154,6 +156,8 @@ finch.yaml: finch-core
154156
.PHONY: finch.yaml
155157
finch.windows.yaml: finch-core-local
156158
mkdir -p $(OUTDIR)/os
159+
# merge the appropriate YAMLs
160+
cd finch.yaml.d && yq eval-all '. as $$item ireduce ({}; . *+ $$item)' windows.yaml common.yaml > ../finch.windows.yaml
157161
cp finch.windows.yaml $(OUTDIR)/os/finch.yaml
158162
# using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed
159163
# this sed command uses the alternative separator of "|" because the image location uses "/"

Diff for: finch.windows.yaml

-114
This file was deleted.

0 commit comments

Comments
 (0)