Skip to content

Fix error unexpected symbol: {{ located at position 14 within expression #4

Fix error unexpected symbol: {{ located at position 14 within expression

Fix error unexpected symbol: {{ located at position 14 within expression #4

Workflow file for this run

name: Docker build
on:
push:
branches:
- main
tags:
- "*"
pull_request:
env:
DOCKER_ORG: coffeateam
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
release: "0.7.22"
releasev0: "0.7.22"
jobs:
matrix-build:
strategy:
fail-fast: false
matrix:
image_dir: [basev0, dask]
flavour: [alma8, ubuntu]
python: ["3.9", "3.10", "3.11"]
exclude:
- image_dir: alma8
python: 3.9
name: ${{ matrix.image_dir }}-${{ matrix.flavour }}-${{ matrix.python }}
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.event_name == 'push'
with:
username: ${{ secrets.DOCKERHUB_ACCOUNT }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
#- name: Login to GitHub Container Registry
# uses: docker/login-action@v1
# if: github.event_name == 'push'
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate tags
id: tags
env:
image_dir: ${{ matrix.image_dir }}
python: ${{ matrix.python }}
flavour: ${{ matrix.flavour }}
run: |
image="coffeateam/coffea-${image_dir}-${flavour}"
if [ ${image_dir} == 'basev0' ]; then
tag="${image}:${releasev0}-py${python}"
else
tag="${image}:${release}-py${python}"
tags=${image}:latest-py${python},$tag
echo "::set-output name=tag::${tag}"
echo "::set-output name=tags::${tags}"
- name: Build
uses: docker/build-push-action@v5
with:
load: true
tags: ${{ steps.tags.outputs.tag }}
context: ${{ matrix.image_dir }}/${{ matrix.flavour }}
file: ${{ matrix.image_dir }}//${{ matrix.flavour }}/Dockerfile
build-args: |
python=${{ matrix.python }}
release=${{ env.release }}
- name: Test Conda environement
env:
tag: ${{ steps.tags.outputs.tag }}
run: |
docker run --rm ${tag} conda list --export
- name: Make sure voms tools are working
env:
tag: ${{ steps.tags.outputs.tag }}
run: |
ERROR=$(docker run ${tag} voms-proxy-info 2>&1 > /dev/null; exit 0)
TEST=$(echo -e "\nCouldn't find a valid proxy.\n")
if [ "$ERROR" == "$TEST" ]; then
exit 0
else
exit 1
fi
- name: Test Pytest environement
env:
tag: ${{ steps.tags.outputs.tag }}
run: |
docker run --rm -v ${{ github.workspace }}:/tmp/workspace ${tag} \
sh -c "pip install -U pytest && cd tmp/workspace && pytest"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ matrix.image_dir }}
file: ${{ matrix.image_dir }}/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.tags.outputs.tags }}
build-args: |
python=${{ matrix.python }}
release=${{ env.release }}