From 0a2cc7b3a6355a74ad1676a78c14e57f8b51b8a9 Mon Sep 17 00:00:00 2001 From: 1138-4EB <1138-4EB@users.noreply.github.com> Date: Mon, 9 Sep 2019 07:38:45 +0200 Subject: [PATCH] gha: add workflow 'images.yml' --- .github/images.sh | 21 +++++++++++++++++ .github/workflows/images.yml | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100755 .github/images.sh create mode 100644 .github/workflows/images.yml diff --git a/.github/images.sh b/.github/images.sh new file mode 100755 index 0000000000..28f708d50f --- /dev/null +++ b/.github/images.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Stop in case of error +set -e + +docker build \ + --build-arg IMAGE="python:$PYVER-slim-buster" \ + --build-arg LLVM_VER=7 \ + --build-arg GNAT_VER=8 \ + --target vunit \ + -t "vunit/dev:${TAG}" \ + - <<-EOF +$(curl -fsSL https://raw.githubusercontent.com/ghdl/docker/master/dockerfiles/run_debian) + +FROM $TGT AS vunit +COPY --from=ghdl/pkg:buster-$PKG / /test + +RUN tar xzf \$(ls /test/ghdl-*) -C /usr/local/ \\ + && rm -rf /test \ + && pip install tox colorama +EOF diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml new file mode 100644 index 0000000000..f9a74debd1 --- /dev/null +++ b/.github/workflows/images.yml @@ -0,0 +1,44 @@ +name: 'images' + +on: + push: + paths: + - '.github/workflows/images.yml' + - '.github/images.sh' + schedule: + - cron: '0 0 * * 5' + +env: + DOCKER_BUILDKIT: '1' + +jobs: + build: + strategy: + fail-fast: false + max-parallel: 3 + matrix: + task: [ + { tag: llvm, pyver: 3, tgt: llvm, pkg: llvm-7 }, + { tag: mcode, pyver: 3, tgt: mcode, pkg: mcode }, + { tag: mcode-2, pyver: 2, tgt: mcode, pkg: mcode }, + ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Run job + env: + TAG: ${{ matrix.task.tag }} + PYVER: ${{ matrix.task.pyver }} + TGT: ${{ matrix.task.tgt }} + PKG: ${{ matrix.task.pkg }} + run: | + ./.github/images.sh + - name: Deploy to hub.docker.com + env: + DOCKER_USER: ${{ secrets.DOCKER_USER }} + DOCKER_PASS: ${{ secrets.DOCKER_PASS }} + TAG: ${{ matrix.task.tag }} + run: | + echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin + docker push vunit/dev:$TAG + docker logout