Skip to content

Bump docker/login-action from 3 to 4 (#94) #568

Bump docker/login-action from 3 to 4 (#94)

Bump docker/login-action from 3 to 4 (#94) #568

Workflow file for this run

name: Build Test
# Builds and tests paynt and deploys images to Dockerhub
on:
push:
branches:
- master
schedule:
# run weekly
- cron: '0 10 * * 3'
# needed to trigger the workflow manually
workflow_dispatch:
pull_request:
env:
# GitHub runners currently have 4 cores
NR_JOBS: "4"
jobs:
latestTests:
name: Test on latest (${{ matrix.build_type.name }})
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
build_type:
- {name: "Debug",
stormpy_base: "ci-debug",
docker_tag: "ci-debug",
build_type: "Debug",
setup_args: "",
optional_libs: "[test]"
}
- {name: "Release",
stormpy_base: "ci",
docker_tag: "ci",
build_type: "Release",
setup_args: "",
optional_libs: "[test]"
}
fail-fast: false
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Build paynt image from Dockerfile
run: |
docker build -t randriu/paynt:${{ matrix.build_type.docker_tag }} . \
--build-arg BASE_IMAGE=movesrwth/stormpy:${{ matrix.build_type.stormpy_base }} \
--build-arg build_type=${{ matrix.build_type.build_type }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci randriu/paynt:${{ matrix.build_type.docker_tag }}
- name: Run PAYNT tests
run: docker exec ci bash -c "cd /opt/paynt; pytest tests"
- name: Run Payntbind tests
run: docker exec ci bash -c "cd /opt/paynt/payntbind; pytest tests"
stableTests:
name: Test on stable (${{ matrix.build_type.name }})
runs-on: ubuntu-latest
strategy:
matrix:
build_type:
- {name: "Debug",
stormpy_base: "stable-debug",
docker_tag: "stable-debug",
build_type: "Debug",
setup_args: "",
optional_libs: "[test]"
}
- {name: "Release",
stormpy_base: "stable",
docker_tag: "stable",
build_type: "Release",
setup_args: "",
optional_libs: "[test]"
}
# Allow failures of stable versions as new features might have been added
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Replace Dockerfile
run: cp .github/workflows/Dockerfile.stable Dockerfile
- name: Build dependencies
run: |
docker build -t randriu/paynt:${{ matrix.build_type.docker_tag }} . \
--build-arg BASE_IMAGE=movesrwth/stormpy:${{ matrix.build_type.stormpy_base }} \
--build-arg build_type=${{ matrix.build_type.build_type }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci randriu/paynt:${{ matrix.build_type.docker_tag }}
- name: Build PAYNT
# Build PAYNT explicitly to catch exit code
shell: bash {0} // Deactivate fast-fail to handle exit code for incompatibility
run: |
docker exec ci bash -c "cd /opt/paynt; pip install -r build-requirements.txt ; pip install -v --no-build-isolation --config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=${NR_JOBS} --config-settings=cmake.build-type=${{ matrix.build_type.build_type }} ${{ matrix.build_type.setup_args }} .${{ matrix.build_type.optional_libs }}"
status=$?
if [ $status -eq 1 ]; then
# Warn about possible incompatibility but do not handle as failure
echo "::warning file=payntbind/CMakeLists.txt,line=44::PAYNT might be incompatible with stable version of Storm/StormPy"
# Deactivate tests
echo "run_tests=false" >> $GITHUB_OUTPUT
else
echo "run_tests=true" >> $GITHUB_OUTPUT
exit $status
fi
- name: Run PAYNT tests
run: docker exec ci bash -c "cd /opt/paynt; pytest tests"
- name: Run Payntbind tests
run: docker exec ci bash -c "cd /opt/paynt/payntbind; pytest tests"
linuxTests:
name: Linux Test (Fetch, ${{ matrix.config.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {name: "Ubuntu 24.04, Debug",
base_image: "movesrwth/storm-basesystem:ubuntu-24.04",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF",
optional_libs: "[test]",
test_opt: ""
}
- {name: "Ubuntu 24.04, Release",
base_image: "movesrwth/storm-basesystem:ubuntu-24.04",
build_type: "Release",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF",
optional_libs: "[test]",
test_opt: ""
}
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Replace Dockerfile
run: cp .github/workflows/Dockerfile.fetch Dockerfile
- name: Build PAYNT
run: |
docker build -t randriu/paynt:ci . \
--build-arg BASE_IMAGE=${{ matrix.config.base_image }} \
--build-arg build_type=${{ matrix.config.build_type }} \
--build-arg setup_args="${{ matrix.config.setup_args }}" \
--build-arg options=${{ matrix.config.optional_libs }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci randriu/paynt:ci
- name: Run PAYNT tests
run: docker exec ci bash -c "cd /opt/paynt; pytest tests"
- name: Run Payntbind tests
run: docker exec ci bash -c "cd /opt/paynt/payntbind; pytest tests"
macTests:
name: Mac Tests (Fetch, ${{ matrix.config.name }})
strategy:
fail-fast: false
matrix:
config:
- {name: "XCode Latest, ARM, Debug",
distro: "macos-15",
xcode: "latest-stable",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF",
optional_libs: "[test]"
}
- {name: "XCode Latest, ARM, Release",
distro: "macos-15",
xcode: "latest-stable",
build_type: "Release",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF",
optional_libs: "[test]"
}
- {name: "XCode Latest, Intel, Debug",
distro: "macos-15-intel",
xcode: "latest-stable",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF",
optional_libs: "[test]"
}
runs-on: ${{ matrix.config.distro }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.config.xcode }}
- name: Git clone
uses: actions/checkout@v6
- name: Install dependencies
# cmake and gmp and python3 are already installed
run: |
brew update
brew install automake boost cln ginac glpk hwloc xerces-c z3
- name: Build PAYNT
run: |
pip install -v \
--config-settings=cmake.build-type=${{ matrix.config.build_type }} \
--config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=${NR_JOBS} \
${{ matrix.config.setup_args }} .${{ matrix.config.optional_libs }}
- name: Run PAYNT tests
run: pytest tests
- name: Run Payntbind tests
run: |
cd payntbind
pytest tests
deploy:
name: Test and Deploy on latest (${{ matrix.build_type.name }})
runs-on: ubuntu-latest
strategy:
matrix:
build_type:
- {name: "Debug",
docker_tag: "ci-debug",
stormpy_base: "ci-debug",
build_type: "Debug",
setup_args: "",
optional_libs: "[test]"
}
- {name: "Release",
docker_tag: "ci",
stormpy_base: "ci",
build_type: "Release",
setup_args: "",
optional_libs: "[test]"
}
fail-fast: false
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Build paynt image from Dockerfile
run: |
docker build -t randriu/paynt:${{ matrix.build_type.docker_tag }} . \
--build-arg BASE_IMAGE=movesrwth/stormpy:${{ matrix.build_type.stormpy_base }} \
--build-arg build_type=${{ matrix.build_type.build_type }} \
--build-arg setup_args="${{ matrix.build_type.setup_args }}" \
--build-arg options=${{ matrix.build_type.optional_libs }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci randriu/paynt:${{ matrix.build_type.docker_tag }}
- name: Run PAYNT tests
run: docker exec ci bash -c "cd /opt/paynt; pytest tests"
- name: Run Payntbind tests
run: docker exec ci bash -c "cd /opt/paynt/payntbind; pytest tests"
- name: Login into docker
# Only login if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'randriu' && github.ref == 'refs/heads/master'
run: echo '${{ secrets.STORMPY_CI_DOCKER_PASSWORD }}' | docker login -u randriu --password-stdin
- name: Deploy paynt image
# Only deploy if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'randriu' && github.ref == 'refs/heads/master'
run: docker push randriu/paynt:${{ matrix.build_type.docker_tag }}