Skip to content

Commit

Permalink
gha: add workflow 'images.yml'
Browse files Browse the repository at this point in the history
  • Loading branch information
1138-4EB committed Oct 13, 2019
1 parent c54f3af commit 0a2cc7b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/images.sh
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0a2cc7b

Please sign in to comment.