-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (96 loc) · 3.87 KB
/
ci.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
108
109
110
name: CI
on: [push]
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
container: dynawo/dynawo-ci:latest
env:
DYNAWO_BUILD_TYPE: Debug
DYNAWO_RESULTS_SHOW: "false"
DYNAWO_FORCE_CXX11_ABI: "true"
DYNAWO_NB_PROCESSORS_USED: 2
DYNAWO_VERSION: 1.5.0
GH_API_DYNAWO: ${{ github.api_url }}/repos/${{ github.repository_owner }}/dynawo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURL_JSON: 'curl --silent -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" --header "Content-Type: application/json"'
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Fetch Dynawo
run: |
source .github/workflows/tools.sh
download_asset $GH_API_DYNAWO nightly-release Dynawo_headers_V${DYNAWO_VERSION}.zip $GITHUB_TOKEN
- name: Unzip Dynawo
run: |
unzip "Dynawo_headers_V${DYNAWO_VERSION}.zip"
- name: Dynawo version
run: ./dynawo/dynawo.sh version
- name: Build
run: |
source /etc/profile.d/00-modulepath.sh
source /etc/profile.d/modules.sh
source /usr/share/lmod/lmod/init/bash
module load mpi/mpich-x86_64
export DYNAWO_HOME=$(pwd)/dynawo
export DYNAWO_ALGORITHMS_HOME=$(pwd)
util/envDynawoAlgorithms.sh build
coverage:
runs-on: ubuntu-latest
container: dynawo/dynawo-ci:latest
env:
DYNAWO_BUILD_TYPE: Debug
DYNAWO_FORCE_CXX11_ABI: "true"
DYNAWO_RESULTS_SHOW: "false"
DYNAWO_NB_PROCESSORS_USED: 2
DYNAWO_VERSION: 1.5.0
GH_API_DYNAWO: ${{ github.api_url }}/repos/${{ github.repository_owner }}/dynawo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURL_JSON: 'curl --silent -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" --header "Content-Type: application/json"'
steps:
- name: Install Sonar wrapper
working-directory: ${{ runner.workspace }}
env:
CONTAINER_WORKSPACE: ${{ runner.workspace }}
run: |
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
- name: Install Sonar scanner
working-directory: ${{ runner.workspace }}
env:
SONAR_SCANNER_VERSION: 4.6.0.2311
run: |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
unzip sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
ln -s sonar-scanner-${SONAR_SCANNER_VERSION} sonar
rm sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
dnf install -y java-11-openjdk
- name: Checkout sources
uses: actions/checkout@v1
- name: Fetch Dynawo
run: |
source .github/workflows/tools.sh
download_asset $GH_API_DYNAWO nightly-release Dynawo_omc_V${DYNAWO_VERSION}.zip $GITHUB_TOKEN
- name: Unzip Dynawo
run: |
unzip "Dynawo_omc_V${DYNAWO_VERSION}.zip"
- name: Build
env:
CONTAINER_WORKSPACE: ${{ runner.workspace }}
run: |
source /etc/profile.d/00-modulepath.sh
source /etc/profile.d/modules.sh
source /usr/share/lmod/lmod/init/bash
module load mpi/mpich-x86_64
export DYNAWO_HOME=$(pwd)/dynawo
export DYNAWO_ALGORITHMS_HOME=$(pwd)
$CONTAINER_WORKSPACE/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output util/envDynawoAlgorithms.sh build-tests-coverage
- name: Sonarcloud
working-directory: ${{ runner.workspace }}/dynawo-algorithms
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
CONTAINER_WORKSPACE: ${{ runner.workspace }}
run: $CONTAINER_WORKSPACE/sonar/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.cfamily.threads=2