Skip to content

Commit

Permalink
Build arm image (and update actions) (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s authored Sep 28, 2023
1 parent f15aaf9 commit 6bf203c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 12 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,31 @@ name: Build Images
on:
push:
branches:
- master
- main
- master
- main

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: get golang version 1
run: |
export VERSION=$(cat .golang_version | awk -F',' '{print $1}' | sed 's/go1/go-1/')
Expand Down Expand Up @@ -43,33 +58,36 @@ jobs:
echo "value=$(echo -n $VAL)" >> $GITHUB_OUTPUT
id: toolchain_build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: build toolchain image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
if: steps.toolchain_build.outputs.value != '0'
with:
context: docker/toolchain/
platforms: linux/amd64,linux/arm64
tags: techknowlogick/xgo:toolchain
push: true
file: docker/toolchain/Dockerfile
- name: build golang ${{ steps.golang_version_1.outputs.value }} image base
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: docker/${{ steps.golang_version_1.outputs.value }}/
platforms: linux/amd64,linux/arm64
tags: techknowlogick/xgo:${{ steps.golang_version_1.outputs.value }}-base
push: true
file: docker/${{ steps.golang_version_1.outputs.value }}/Dockerfile
build-contexts: |
toolchain=docker-image://techknowlogick/xgo:toolchain
- name: build golang ${{ steps.golang_version_1.outputs.value }} image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
tags: techknowlogick/xgo:${{ steps.golang_version_1.outputs.value }},techknowlogick/xgo:${{ steps.golang_version_1.outputs.wildcard }}
push: true
build-args: |
Expand All @@ -78,9 +96,10 @@ jobs:
build-contexts: |
${{ steps.golang_version_1.outputs.value }}-base=docker-image://techknowlogick/xgo:${{ steps.golang_version_1.outputs.value }}-base
- name: build golang ${{ steps.golang_version_2.outputs.value }} image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: docker/${{ steps.golang_version_2.outputs.value }}/
platforms: linux/amd64,linux/arm64
tags: techknowlogick/xgo:${{ steps.golang_version_2.outputs.value }}-base
push: true
file: docker/${{ steps.golang_version_2.outputs.value }}/Dockerfile
Expand All @@ -90,6 +109,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
tags: techknowlogick/xgo:${{ steps.golang_version_2.outputs.value }},techknowlogick/xgo:${{ steps.golang_version_2.outputs.wildcard }}
push: true
build-args: |
Expand All @@ -98,9 +118,10 @@ jobs:
build-contexts: |
${{ steps.golang_version_2.outputs.value }}-base=docker-image://techknowlogick/xgo:${{ steps.golang_version_2.outputs.value }}-base
- name: build latest image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: docker/go-latest/
platforms: linux/amd64,linux/arm64
tags: techknowlogick/xgo:latest
push: true
file: docker/go-latest/Dockerfile
30 changes: 28 additions & 2 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,36 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 2
# FIXME: https://github.com/jlumbroso/free-disk-space/issues/17
- name: same as 'large-packages' but without 'google-cloud-sdk'
shell: bash
run: |
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt-get autoremove -y
sudo apt-get clean
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- name: get golang version 1
run: |
export VERSION=$(cat .golang_version | awk -F',' '{print $1}' | sed 's/go1/go-1/')
Expand Down Expand Up @@ -85,4 +112,3 @@ jobs:
echo "Run tests on latest go ${{ steps.golang_version_1.outputs.value }}"
env IMAGEID="techknowlogick/xgo:${{ steps.golang_version_1.outputs.value }}" bats xgo.bats

0 comments on commit 6bf203c

Please sign in to comment.