Skip to content

CSCS-CI ext

CSCS-CI ext #315

name: Build Testing Container Package
on:
workflow_dispatch:
pull_request:
push:
paths:
- '!.github/**'
jobs:
build-test-image:
runs-on: ubuntu-latest
strategy:
matrix:
version:
- 20.11.9
- 22.05.2
- 22.05.6
- 23.02.7
env:
base_tag: ghcr.io/eth-cscs/slurm-container-${{ matrix.version }}:latest
cache_tag: ghcr.io/eth-cscs/cache_docker/slurm-uenv-mount-tester-${{ matrix.version }}:latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build tester image
uses: docker/build-push-action@v3
with:
context: .
file: ci/Dockerfile
push: true
tags: ${{ env.cache_tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args:
DOCKER_CONTAINER=${{ env.base_tag }}
build-and-test:
needs: build-test-image
runs-on: ubuntu-latest
strategy:
matrix:
version:
- 20.11.9
- 22.05.2
container:
image: ghcr.io/eth-cscs/cache_docker/slurm-uenv-mount-tester-${{ matrix.version }}:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
NODE_HW: CPUS=2
options: --cpus 2 --privileged
steps:
- uses: actions/checkout@v3
- run: |
meson setup builddir
meson install -C builddir
- run:
echo "required /usr/local/lib64/libslurm-uenv-mount.so" > /etc/slurm/plugstack.conf
- run: |
# initialization
/entrypoint.sh
sinfo
- run: |
echo "Run tests in bash-bats"
su testuser -c bash <<\EOF
bats ci/tests
EOF