Skip to content

Commit

Permalink
build: unify macos/windows yamls (#921)
Browse files Browse the repository at this point in the history
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 <alvajus@amazon.com>
  • Loading branch information
pendo324 authored Apr 29, 2024
1 parent fd7c61d commit 86d9a23
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 397 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
fi
- name: Install Rosetta 2
run: echo "A" | softwareupdate --install-rosetta || true
- run: brew install go lz4 automake autoconf libtool
- run: brew install go lz4 automake autoconf libtool yq
shell: zsh {0}
- name: Build project
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
cache: true
- name: Make macos aarch64 build
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
git status
git clean -f -d
make clean
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:

- name: Make macos x86_64 build
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
git status
git clean -f -d
make clean
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
fi
- name: Install Rosetta 2
run: echo "A" | softwareupdate --install-rosetta || true
- run: brew install lz4 automake autoconf libtool
- run: brew install lz4 automake autoconf libtool yq
shell: zsh {0}
- name: Build project
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-homebrew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-build-to-S3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cache: true
- name: Make macos aarch64 build
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
make clean
make download-licenses
make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
cache: true
- name: Make macos x86_64 build
run: |
brew install lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool yq
make clean
make download-licenses
make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ For more details, see [`.golangci.yaml`](./.golangci.yaml) and the `lint` target
Before building, install dependencies required to build the project binaries.

```sh
brew install go lz4 automake autoconf libtool
brew install go lz4 automake autoconf libtool yq
```

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.
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ endif
.PHONY: finch.yaml
finch.yaml: finch-core
mkdir -p $(OUTDIR)/os
# merge the appropriate YAMLs
cd finch.yaml.d && yq eval-all '. as $$item ireduce ({}; . *+ $$item)' mac.yaml common.yaml > ../finch.yaml
cp finch.yaml $(OUTDIR)/os
# using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed
# this sed command uses the alternative separator of "|" because the image location uses "/"
Expand All @@ -154,6 +156,8 @@ finch.yaml: finch-core
.PHONY: finch.yaml
finch.windows.yaml: finch-core-local
mkdir -p $(OUTDIR)/os
# merge the appropriate YAMLs
cd finch.yaml.d && yq eval-all '. as $$item ireduce ({}; . *+ $$item)' windows.yaml common.yaml > ../finch.windows.yaml
cp finch.windows.yaml $(OUTDIR)/os/finch.yaml
# using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed
# this sed command uses the alternative separator of "|" because the image location uses "/"
Expand Down
114 changes: 0 additions & 114 deletions finch.windows.yaml

This file was deleted.

Loading

0 comments on commit 86d9a23

Please sign in to comment.