-
Notifications
You must be signed in to change notification settings - Fork 5
107 lines (84 loc) · 3.64 KB
/
dockerimage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Docker Image CI
on:
pull_request:
paths:
- '.github/docker_ubuntu_bionic/DockerFile'
- '.github/workflows/dockerimage.yml'
schedule:
- cron: '0 2 * * TUE'
jobs:
create-docker-ubuntu:
strategy:
fail-fast: false
matrix:
salome-version: [9-3, 9-4, 9-5, 9-6]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Build the Docker image for salome version ${{ matrix.salome-version }}
run: |
# even after a new version is released the old download paths remain active
# if they should become inactive some day one can switch to the links from the previous releases
if [ ${{ matrix.salome-version }} == 9-3 ]; then
SALOME_DOWNLOAD_PATH="https://www.salome-platform.org/downloads/current-version/DownloadDistr?platform=OS1.UB18.04&version=9.3.0"
elif [ ${{ matrix.salome-version }} == 9-4 ]; then
SALOME_DOWNLOAD_PATH="https://www.salome-platform.org/downloads/current-version/DownloadDistr?platform=SP.UB18.04&version=9.4.0"
elif [ ${{ matrix.salome-version }} == 9-5 ]; then
SALOME_DOWNLOAD_PATH="https://www.salome-platform.org/downloads/current-version/DownloadDistr?platform=SP.UB18.04&version=9.5.0"
elif [ ${{ matrix.salome-version }} == 9-6 ]; then
SALOME_DOWNLOAD_PATH="https://www.salome-platform.org/downloads/current-version/DownloadDistr?platform=SP.UB18.04&version=9.6.0"
else
echo 'No "SALOME_DOWNLOAD_PATH" configured for version ${{ matrix.salome-version }}'
exit 1
fi
# output configuration
echo "SALOME_DOWNLOAD_PATH:" ${SALOME_DOWNLOAD_PATH}
docker build . --file .github/docker_ubuntu_bionic/DockerFile \
--tag philbucher/ubuntu-18-04-salome-${{ matrix.salome-version }} \
--build-arg salome_download_path=${SALOME_DOWNLOAD_PATH}
- name: Docker Login
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish the Docker image for salome version ${{ matrix.salome-version }}
run: docker push philbucher/ubuntu-18-04-salome-${{ matrix.salome-version }}
# TODO maybe in the future a better solution can be found for the execution of the tests after the docker is rebuilt
# right now quite some copy paste is necessary
testing-in-salome:
needs: create-docker-ubuntu
strategy:
fail-fast: false
matrix:
salome-version: [9-3, 9-4, 9-5, 9-6]
runs-on: ubuntu-18.04
container:
image: philbucher/ubuntu-18-04-salome-${{ matrix.salome-version }}:latest
steps:
- uses: actions/checkout@v1
- name: Running tests in salome version ${{ matrix.salome-version }}
# "--shutdown-servers=1" is not used bcs container is shut down right after
env:
PYQT_AVAILABLE: 1
QT_QPA_PLATFORM: offscreen
LANG: C.UTF-8 # see https://stackoverflow.com/a/51302441
run: |
cd tests
python3 ../execute_in_salome.py /root/salome_dir/salome run_all_tests.py
check-salome-execution-detection:
# TODO this should also check if the version-fct returns correct results
needs: create-docker-ubuntu
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
salome-version: [9-3, 9-4, 9-5, 9-6]
runs-on: ubuntu-18.04
container:
image: philbucher/ubuntu-18-04-salome-${{ matrix.salome-version }}:latest
steps:
- uses: actions/checkout@v1
- name: assert run in salome
run: |
cd .github
python3 ../execute_in_salome.py /root/salome_dir/salome assert_run_in_salome.py 1