forked from ukaea/parallel-preprocessor
-
Notifications
You must be signed in to change notification settings - Fork 2
106 lines (96 loc) · 4.27 KB
/
docker-ci.yml
File metadata and controls
106 lines (96 loc) · 4.27 KB
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
name: fedora-debian
on: [push, pull_request]
env:
PROJECT_NAME: "parallel-preprocessor"
PROJECT_VERSION: "0.3-dev"
MODULE_FOLDERS: "./src/"
jobs:
ppp-fedora-docker-ci:
name: 'build ${{ matrix.os }} package in docker'
runs-on: 'ubuntu-latest'
strategy:
matrix:
include:
- os: 'fedora-32'
compiler: gcc
compilerpp: g++
package_suffix: 'rpm'
docker-image: "fedora:32"
- os: 'fedora-31'
compiler: gcc
compilerpp: g++
package_suffix: 'rpm'
docker-image: "fedora:31"
# - os: 'centos-8'
# compiler: gcc
# compilerpp: g++
# package_suffix: 'rpm'
# docker-image: "centos:8"
- os: 'debian-10'
compiler: gcc
compilerpp: g++
package_suffix: 'deb'
docker-image: "debian:10" # version 10 buster
container:
image: ${{ matrix.docker-image }}
steps:
- name: 'install dependencies on fedora'
id: 'install-dep-fedora'
run: |
yum install g++ gcc cmake make rpm-build git wget copr-cli -y && yum update -y
yum install tbb tbb-devel freetype freetype-devel freeimage freeimage-devel \
glew-devel SDL2-devel SDL2_image-devel glm-devel libXmu-devel libXi-devel \
python3 python3-devel boost-devel -y
yum install opencascade-foundation opencascade-modeling opencascade-ocaf \
opencascade-visualization opencascade-devel -y
if: matrix.os == 'fedora-31' || matrix.os == 'fedora-32'
- name: 'install dependencies on debian'
id: 'install-dep-debian'
run: |
apt-get update
apt-get install -y g++ cmake git gcc build-essential
apt-get install -y libtbb*-dev libocct-*-dev occt-misc python3-dev python3-pybind11 libboost-dev
apt-get install -y libx11-dev libxmu-dev libxi-dev
if: matrix.os == 'debian-10'
- uses: actions/checkout@v2
# GitHub's actions/checkout requires git version 2.18 or later, if run inside docker
#- name: Checkout submodules
# uses: textbook/git-checkout-submodule-action@master
- name: 'build package'
id: 'build-package'
working-directory: ${{ github.workspace }}
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilerpp }}
run: |
echo "git version: $(git --version), $PWD, $(ls -al .)"
git submodule update --init --recursive # use an action instead
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DPython_EXECUTABLE=$(which python3) -DPPP_VERSION_NAME=${{ env.PROJECT_VERSION }} .. -Wno-dev
make 2>&1 | tee clang_tidy_build_results.log
make package
ls *.${{ matrix.package_suffix }}
if hash dpkg 2>/dev/null; then dpkg -i *.${{ matrix.package_suffix }}; fi
if hash rpm 2>/dev/null; then rpm -Uhv *.${{ matrix.package_suffix }}; fi
# copy the package to $GITHUB_WORKSPACE, pointer to host path, is not possible, while upload from ${{ github.workspace }} is fine
mv *.${{ matrix.package_suffix }} ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}_${{ matrix.os }}.${{ matrix.package_suffix }}
################### testing ##########################
- name: Run unit tests
working-directory: ${{ github.workspace }}/build
run: |
echo "start unit test in the folder:$(pwd)"
if [ ! -f "run_all_tests.sh" ]; then cp ../scripts/run_all_tests.sh ./ ; fi
sh run_all_tests.sh
if: always() # tmp skip this step if failed
# those release asset filename (is created manually before running this action)
- name: Upload binary package to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/build/${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}_${{ matrix.os }}.${{ matrix.package_suffix }}
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}_${{ matrix.os }}.${{ matrix.package_suffix }}
tag: dev
overwrite: true
prerelease: true
if: github.ref == 'refs/heads/main' # only upload package on main branch, not PR, forks, which has no write access