Skip to content

use parallel testings #3343

use parallel testings

use parallel testings #3343

name: Update Image
on:
push:
workflow_dispatch:
env:
IMAGE_PATH: openmss
IMAGE_NAME: mss
jobs:
test-and-publish-stable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build image
run: docker build . --tag $IMAGE_PATH/$IMAGE_NAME:latest
- name: Test image
timeout-minutes: 45
run: |
docker run $IMAGE_PATH/$IMAGE_NAME:latest /bin/bash -c "
git clone https://github.com/Open-MSS/MSS.git &&
cd MSS &&
git checkout stable &&
source /opt/conda/bin/activate mssenv &&
mamba install --file requirements.d/development.txt &&
apt-get update &&
apt-get install dialog apt-utils -y &&
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections &&
apt-get install xvfb -y &&
mamba install pyvirtualdisplay &&
conda deactivate &&
source /opt/conda/bin/activate mssenv &&
[ -d "~/.cache/matplotlib" ] && rm -r ~/.cache/matplotlib/ ;
pytest -v -n 6 --dist loadfile --max-worker-restart 4 tests \
|| (for i in {1..5} \
; do pytest tests --last-failed --lfnf=none \
&& break \
; done)"
- name: Slack Notify
if: ${{ failure() }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"[${{ github.repository }}] <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run failed>: ${{ github.workflow }} in ${{ github.ref_name }}"}' ${{ secrets.SLACK_WEBHOOK }}
- name: Print conda list
if: ${{ always() }}
run: |
docker run $IMAGE_PATH/$IMAGE_NAME:latest /bin/bash -c "
source /opt/conda/bin/activate mssenv &&
mamba list
"
- name: Log into dockerhub
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_ACCOUNT }} --password-stdin
- name: Push image
run: docker push $IMAGE_PATH/$IMAGE_NAME:latest