Skip to content

Commit

Permalink
cleanup: Use github actions matrix; delete some old images.
Browse files Browse the repository at this point in the history
We haven't been building these windows images anymore for a long time
now, since we're able to cross-compile more efficiently and also use
native windows builds.
  • Loading branch information
iphydf committed Dec 27, 2023
1 parent a739908 commit 92fde8c
Show file tree
Hide file tree
Showing 29 changed files with 42 additions and 606 deletions.
355 changes: 19 additions & 336 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,151 +17,10 @@ concurrency:
cancel-in-progress: true

jobs:
freebsd:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:freebsd"
tags: toxchat/freebsd:latest
cache-from: type=registry,ref=toxchat/freebsd:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

alpine-s390x:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:alpine-s390x"
tags: toxchat/alpine-s390x:latest
cache-from: type=registry,ref=toxchat/alpine-s390x:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

##################################################
#
# :: Haskell dev base images (better caching)
#
##################################################

haskell:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:haskell"
tags: toxchat/haskell:latest
cache-from: type=registry,ref=toxchat/haskell:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

##################################################
#
# :: Frama-C static analyser
#
##################################################

frama-c:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:frama-c"
tags: toxchat/frama-c:latest
cache-from: type=registry,ref=toxchat/frama-c:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

##################################################
#
# :: Flutter dev base images (better caching)
#
##################################################

flutter-web:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:flutter/web"
tags: toxchat/flutter-web:latest
cache-from: type=registry,ref=toxchat/flutter-web:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

##################################################
#
# :: Bazel docker-sandbox and buildfarm images
#
##################################################

bazel-cache:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:buildfarm/cache"
tags: toxchat/bazel-cache:latest
cache-from: type=registry,ref=toxchat/bazel-cache:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

bazel:
build:
strategy:
matrix:
image: [alpine-s390x, bazel, bazel-cache, flutter-web, frama-c, freebsd, haskell]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
Expand All @@ -175,13 +34,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Build image
run: cd buildfarm/bazel && ./build.sh
if: hashFiles('${{ matrix.image }}/build.sh') != ''
run: |
cd ${{ matrix.image }} && [ ! -e build.sh ] || ./build.sh
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "buildfarm/bazel"
tags: toxchat/bazel:latest
cache-from: type=registry,ref=toxchat/bazel:latest
context: "${{ matrix.image }}"
tags: toxchat/${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

Expand Down Expand Up @@ -242,110 +103,6 @@ jobs:
# push: true
# tags: toxchat/buildfarm-worker:latest
# cache-from: type=registry,ref=toxchat/buildfarm-worker:latest
# cache-to: type=inline

##################################################
#
# :: Kythe code indexing
#
##################################################

# kythe-release:
# runs-on: ubuntu-latest
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:kythe/release"
# push: true
# tags: toxchat/kythe-release:latest
# cache-from: type=registry,ref=toxchat/kythe-release:latest
# cache-to: type=inline

# kythe-webui:
# runs-on: ubuntu-latest
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:kythe/webui"
# push: true
# tags: toxchat/kythe-webui:latest
# cache-from: type=registry,ref=toxchat/kythe-webui:latest
# cache-to: type=inline

# kythe-buildenv:
# runs-on: ubuntu-latest
# needs: [bazel, kythe-release]
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:kythe/buildenv"
# push: true
# tags: toxchat/kythe-buildenv:latest
# cache-from: type=registry,ref=toxchat/kythe-buildenv:latest
# cache-to: type=inline

# kythe-tables:
# runs-on: ubuntu-latest
# needs: [kythe-buildenv]
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:kythe/tables"
# push: true
# tags: toxchat/kythe-tables:latest
# cache-from: type=registry,ref=toxchat/kythe-tables:latest
# cache-to: type=inline

# kythe-serving:
# runs-on: ubuntu-latest
# needs: [kythe-release, kythe-tables, kythe-webui]
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:kythe/serving"
# push: true
# tags: toxchat/kythe-serving:latest
# cache-from: type=registry,ref=toxchat/kythe-serving:latest
# cache-to: type=inline

##################################################
Expand Down Expand Up @@ -378,87 +135,13 @@ jobs:
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

ghc-android-aarch64:
runs-on: ubuntu-latest
needs: [ghc-base]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Generate configs
run: cd ghc-android && ./configure
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "ghc-android/aarch64"
tags: toktoknet/ghc-android:8.10.7.aarch64
cache-from: type=registry,ref=toktoknet/ghc-android:8.10.7.aarch64
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

ghc-android-arm:
runs-on: ubuntu-latest
needs: [ghc-base]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Generate configs
run: cd ghc-android && ./configure
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "ghc-android/arm"
tags: toktoknet/ghc-android:8.10.7.arm
cache-from: type=registry,ref=toktoknet/ghc-android:8.10.7.arm
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

ghc-android-i686:
runs-on: ubuntu-latest
# basic.c:356:16: error: inline assembly requires more registers than available
if: false
needs: [ghc-base]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Generate configs
run: cd ghc-android && ./configure
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "ghc-android/i686"
tags: toktoknet/ghc-android:8.10.7.i686
cache-from: type=registry,ref=toktoknet/ghc-android:8.10.7.i686
cache-to: type=inline
push: ${{ github.event_name == 'push' }}

ghc-android-x86_64:
ghc-android:
strategy:
matrix:
target: [aarch64, arm]
# basic.c:356:16: error: inline assembly requires more registers than available
#target: [aarch64, arm, i686, x86_64]
runs-on: ubuntu-latest
# basic.c:315:16: error: inline assembly requires more registers than available
if: false
needs: [ghc-base]
steps:
- name: Set up Docker Buildx
Expand All @@ -476,8 +159,8 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "ghc-android/x86_64"
tags: toktoknet/ghc-android:8.10.7.x86_64
cache-from: type=registry,ref=toktoknet/ghc-android:8.10.7.x86_64
context: "ghc-android/${{ matrix.target }}"
tags: toktoknet/ghc-android:8.10.7.${{ matrix.target }}
cache-from: type=registry,ref=toktoknet/ghc-android:8.10.7.${{ matrix.target }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
1 change: 1 addition & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
ignored:
- DL3004 # we use sudo for now (TODO(iphydf): investigate gosu)
- DL3007
- DL3008
- DL3018
Expand Down
Loading

0 comments on commit 92fde8c

Please sign in to comment.