-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 3.72 KB
/
workflow-build.yaml
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
name: Java/C++ Build
on:
workflow_call:
secrets:
MAVEN_REPO_USER:
required: true
MAVEN_REPO_PASS:
required: true
env:
CPP_MODULE_BASE_NAME: "cpp-simulator"
jobs:
build:
runs-on: ubuntu-latest
environment: rss-artifactory-mpw-deploy
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
# Run MDE Workflow
- name: Process MDE workflow with Maven
run: mvn clean install --file pom.xml
# Build and test Java Karasimulator
- name: Build Java Karasimulator
run: mvn --settings simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.java/.m2/settings.xml -B deploy --file simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.java/pom.xml
env:
MAVEN_REPO_USER: ${{ secrets.MAVEN_REPO_USER }}
MAVEN_REPO_PASS: ${{ secrets.MAVEN_REPO_PASS }}
# Build and test C++ Karasimulator
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.5
with:
cmake-version: '3.17.x'
- name: Setup SDL2
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-image-dev
sudo apt-get install libsdl2-ttf-dev
- name: Build C++ Karasimulator
run: cmake -S $PROJECT_CPP_DIR -B $BUILD_DIR && cmake --build $BUILD_DIR
env:
PROJECT_CPP_DIR: simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp
BUILD_DIR: simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp/build
- name: Test C++ Karasimulator
run: cd $BUILD_DIR && ctest --extra-verbose
env:
PROJECT_CPP_DIR: simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp
BUILD_DIR: simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp/build
# Copy deployment artifacts
- name: copy cpp simulator
run: |
mkdir ~/deploy-cpp-simulator-to-branch
cp -R simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp/core ~/deploy-cpp-simulator-to-branch
cp -R simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp/ui ~/deploy-cpp-simulator-to-branch
cp -R simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp/main ~/deploy-cpp-simulator-to-branch
cp -R simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp/examples ~/deploy-cpp-simulator-to-branch
cp simulators/de.unistuttgart.iste.sqa.mpw.karasimulator.cpp/CMakeLists.txt ~/deploy-cpp-simulator-to-branch
# Prepare Git Repository
- name: set identity
run: git config user.email "mpw-deployment@users.noreply.github.com" && git config user.name "Deployment"
# Deploy cpp-simulator to branch
- name: switch to cpp simulator branch
run: git fetch && git checkout ${{ env.CPP_MODULE_BASE_NAME }}-snapshot && git reset --hard 8bc884256d8ba383a1d42ab61f1c662fa2e08935
- name: cpp simulator branch folders
run: |
git clean -ffd
rm -rf ./core && rm -rf ./ui && rm -rf ./main && rm -rf ./examples && rm -f CMakeLists.txt
cp -R ~/deploy-cpp-simulator-to-branch/core ./core
cp -R ~/deploy-cpp-simulator-to-branch/ui ./ui
cp -R ~/deploy-cpp-simulator-to-branch/main ./main
cp -R ~/deploy-cpp-simulator-to-branch/examples ./examples
cp ~/deploy-cpp-simulator-to-branch/CMakeLists.txt ./CMakeLists.txt
- name: commit
run: git add -A && git commit -am 'C++ karasimulator code snapshot' && git push origin ${{ env.CPP_MODULE_BASE_NAME }}-snapshot --force