forked from FAIRDataPipeline/cppDataPipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (109 loc) · 3.54 KB
/
fdp_cpp_api.yaml
File metadata and controls
111 lines (109 loc) · 3.54 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
107
108
109
110
111
name: FDP C++ API
on: [push]
jobs:
Build_Ubuntu:
name: Build Ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: "x64"
- name: Install graphviz
run: |
sudo apt-get install graphviz
- name: Install local registry
run: curl -fsSL https://data.scrc.uk/static/localregistry.sh | /bin/bash -s -- -b main
- name: Checkout FAIRDataPipeline/FAIR-CLI
uses: actions/checkout@v2
with:
repository: FAIRDataPipeline/FAIR-CLI
path: FAIR-CLI
- name: Move FAIR-CLI
run: mv FAIR-CLI ../FAIR-CLI
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install and initialise FAIR CLI
run: |
cd ../FAIR-CLI
poetry install
source .venv/bin/activate
cd ${{ github.workspace }}
fair init --ci
fair registry start
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y lcov libjsoncpp-dev curl libcurl4-openssl-dev libyaml-cpp-dev gcovr
- name: Configure Library
run: |
cmake -Bbuild -DFDPAPI_BUILD_TESTS=ON -DFDPAPI_CODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
- name: Fetch cache
uses: actions/cache@v2.1.5
with:
path: sonarCache
key: ${{ runner.os }}-sonarCache-${{ github.sha }}
restore-keys: ${{ runner.os }}-sonarCache-
- name: Prepare Sonar scanner
run: |
wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.0.2311-linux.zip
unzip -q sonar-scanner-cli-4.6.0.2311-linux.zip
echo "${PWD}/sonar-scanner-4.6.0.2311-linux/bin/" >> $GITHUB_PATH
wget -nv https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip -q build-wrapper-linux-x86.zip
echo "${PWD}/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Build and Run Unit Tests
run: |
build-wrapper-linux-x86-64 --out-dir bw-outputs cmake --build build --target coverage
if [ $? -eq 0 ]; then
echo "Unit tests completed successfully"
exit 0
else
echo "Unit tests failed"
exit 1
fi
env:
CIBuild: 1
BUILD_TESTS: True
- name: SonarCloud Scan
run: |
sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -X
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Build_MacOS:
name: Build MacOS
runs-on: macOS-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
brew install cmake
brew install curl
- name: Configure Library
run: |
cmake -Bbuild -DFDPAPI_BUILD_TESTS=ON
- name: Build Library
run: |
cmake --build build
Build_Windows:
name: Build Windows
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
- name: Configure Library
run: |
cmake -Bbuild -DFDPAPI_BUILD_TESTS=ON
- name: Compile FDP-Cpp-API
run: cmake --build build --config=Release