Skip to content
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

Build arm image (and update actions) #217

Merged
merged 6 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@v3
techknowlogick marked this conversation as resolved.
Show resolved Hide resolved
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
28 changes: 27 additions & 1 deletion .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,33 @@ jobs:
- uses: actions/checkout@v2
techknowlogick marked this conversation as resolved.
Show resolved Hide resolved
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