-
-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Utilize native arm64 linux runners #784
Changes from all commits
b287d89
beed030
27234d3
a2ab7ed
9290692
49cb2df
1173dee
bb0b3ee
dbb7e34
926c8ee
9332320
8ef6b9a
05c6fe5
10aee20
e7667e8
bc50607
abbe2b5
4722ce9
e830854
7f4a6cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,25 @@ env: | |
|
||
jobs: | ||
build: | ||
permissions: | ||
# for MaxymVlasov/dive-action to write comments to PRs | ||
pull-requests: write | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
arch: [amd64, arm64] | ||
arch: | ||
- amd64 | ||
- arm64 | ||
include: | ||
- os-name: Ubuntu x64 | ||
os: ubuntu-latest | ||
arch: amd64 | ||
|
||
- os-name: Ubuntu ARM | ||
os: ubuntu-24.04-arm | ||
arch: arm64 | ||
|
||
name: ${{ matrix.os-name }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
@@ -37,21 +51,17 @@ jobs: | |
tools/*.sh | ||
- name: Set IMAGE environment variable | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# Lowercase the org/repo name to allow for workflow to run in forks, | ||
# which owners have uppercase letters in username | ||
run: >- | ||
echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY@L}:${{ env.IMAGE_TAG }}" | ||
>> $GITHUB_ENV | ||
- name: Set up QEMU | ||
if: matrix.os != 'ubuntu-latest' || matrix.arch != 'amd64' | ||
# yamllint disable-line rule:line-length | ||
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0 | ||
with: | ||
platforms: arm64 | ||
- name: Set up Docker Buildx | ||
# yamllint disable-line rule:line-length | ||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
|
||
- name: Build if Dockerfile changed | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
|
@@ -61,9 +71,6 @@ jobs: | |
context: . | ||
build-args: | | ||
INSTALL_ALL=true | ||
# yamllint disable-line rule:line-length | ||
platforms: >- # Only one allowed here, see https://github.com/docker/buildx/issues/59#issuecomment-1433097926 | ||
linux/${{ matrix.arch }} | ||
push: false | ||
load: true | ||
tags: ${{ env.IMAGE }} | ||
|
@@ -72,18 +79,34 @@ jobs: | |
secrets: | | ||
"github_token=${{ secrets.GITHUB_TOKEN }}" | ||
- name: Setup Container Structure Tests | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
env: | ||
# yamllint disable-line rule:line-length | ||
# renovate: datasource=github-releases depName=container-structure-test lookupName=GoogleContainerTools/container-structure-test | ||
CST_VERSION: 1.19.3 | ||
CST_REPO: github.com/GoogleContainerTools/container-structure-test | ||
run: >- | ||
curl -L "https://${{ env.CST_REPO }}/releases/download/v${{ | ||
env.CST_VERSION }}/container-structure-test-linux-${{ matrix.arch }}" | ||
> container-structure-test | ||
&& chmod +x container-structure-test | ||
&& mkdir -p $HOME/bin/ | ||
&& mv container-structure-test $HOME/bin/ | ||
&& echo $HOME/bin/ >> $GITHUB_PATH | ||
- name: Run structure tests | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# yamllint disable-line rule:line-length | ||
uses: plexsystems/container-structure-test-action@c0a028aa96e8e82ae35be556040340cbb3e280ca # v0.3.0 | ||
with: | ||
image: ${{ env.IMAGE }} | ||
config: .github/.container-structure-test-config.yaml | ||
run: >- | ||
container-structure-test test | ||
--config ${{ github.workspace | ||
}}/.github/.container-structure-test-config.yaml | ||
--image ${{ env.IMAGE }} | ||
- name: Dive - check image for waste files | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# yamllint disable-line rule:line-length | ||
uses: MaxymVlasov/dive-action@379af3fc636888ada5899c997e8b52db6ad45023 # v1.0.1 | ||
uses: MaxymVlasov/dive-action@b6a02b38f0f309e8817199658eab090d4f0f93ce # v1.1.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lol, I spent whole day on it 🤪 |
||
with: | ||
image: ${{ env.IMAGE }} | ||
config-file: ${{ github.workspace }}/.github/.dive-ci.yaml | ||
|
@@ -95,7 +118,6 @@ jobs: | |
if: >- | ||
steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& matrix.os == 'ubuntu-latest' | ||
&& matrix.arch == 'amd64' | ||
# yamllint disable-line rule:line-length | ||
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,9 +23,6 @@ jobs: | |
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Set up QEMU | ||
# yamllint disable-line rule:line-length | ||
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double-checked - it works without it |
||
- name: Set up Docker Buildx | ||
# yamllint disable-line rule:line-length | ||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also has issues with MacOS, which blocks #636, so I replaced it with binary, as I don't want to write my own GHA from scratch for this