1+ #
2+ name : BuildGEMOC
3+
4+ on :
5+ push :
6+
7+ jobs :
8+ pomfirst-build :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+ with :
15+ submodules : ' true'
16+ - name : Show context
17+ run : |
18+ id -u
19+ id -g
20+ echo $HOME
21+ ls -lsa $HOME
22+ echo ${{ github.workspace }}
23+ ls -lsa ${{ github.workspace }}
24+ cd ~
25+ pwd
26+ - name : Cache Maven packages
27+ uses : actions/cache@v4
28+ with :
29+ path : ~/.m2
30+ key : ${{ runner.os }}-m2-pomfirst-${{ hashFiles('**/pom.xml') }}
31+ restore-keys : ${{ runner.os }}-m2-pomfirst
32+
33+ - name : Set UID and GID env
34+ id : vars
35+ # required to correctly map the userId in the docker image
36+ run : |
37+ echo "GHRUNNER_UID=$(id -u)" >> $GITHUB_ENV
38+ echo "GHRUNNER_GID=$(id -g)" >> $GITHUB_ENV
39+ echo "GHRUNNER_HOME=$HOME" >> $GITHUB_ENV
40+ - name : Generate protocol in container
41+ uses : addnab/docker-run-action@v3
42+ with :
43+ image : gemoc/gemoc-builder:latest
44+ options : -v ${{ github.workspace }}:/home/ubuntu/src -v ${{ env.GHRUNNER_HOME }}/.m2:/home/ubuntu/.m2 --env UID=${{ env.GHRUNNER_UID }} --env GID=${{ env.GHRUNNER_GID }}
45+ run : |
46+ echo "This step is using a Public Docker Container Action "
47+ /entrypoint ./generate_protocols.sh
48+ - name : pomfirst build
49+ uses : addnab/docker-run-action@v3
50+ with :
51+ image : gemoc/gemoc-builder:latest
52+ options : -v ${{ github.workspace }}:/home/ubuntu/src -v ${{ env.GHRUNNER_HOME }}/.m2:/home/ubuntu/.m2 --env UID=${{ env.GHRUNNER_UID }} --env GID=${{ env.GHRUNNER_GID }}
53+ run : |
54+ chmod -R a+rw /home/ubuntu/.m2
55+ chown -R ${{ env.GHRUNNER_UID }}:${{ env.GHRUNNER_GID }} /home/ubuntu/.m2
56+ /entrypoint ./pomfirst_build.sh
57+ ls -lsa /home/ubuntu
58+ ls -lsa /home/ubuntu/.m2
59+
60+ tycho-build :
61+ runs-on : ubuntu-latest
62+ steps :
63+ - name : Checkout code
64+ uses : actions/checkout@v4
65+ with :
66+ submodules : ' true'
67+ - name : Show context
68+ run : |
69+ id -u
70+ id -g
71+ echo $HOME
72+ ls -lsa $HOME
73+ echo ${{ github.workspace }}
74+ ls -lsa ${{ github.workspace }}
75+ - name : Cache Maven packages
76+ uses : actions/cache@v3
77+ with :
78+ path : ~/.m2
79+ key : ${{ runner.os }}-m2-tycho-${{ hashFiles('**/pom.xml', '**/MANIFEST.MF', '**/*.target') }}
80+ restore-keys : ${{ runner.os }}-m2-tycho
81+ - name : Set UID and GID env
82+ id : vars
83+ # required to correctly map the userId in the docker image
84+ run : |
85+ echo "GHRUNNER_UID=$(id -u)" >> $GITHUB_ENV
86+ echo "GHRUNNER_GID=$(id -g)" >> $GITHUB_ENV
87+ echo "GHRUNNER_HOME=$HOME" >> $GITHUB_ENV
88+ - name : Generate Protocol classes
89+ uses : addnab/docker-run-action@v3
90+ with :
91+ image : gemoc/gemoc-builder:latest
92+ options : -v ${{ github.workspace }}:/home/ubuntu/src -v ${{ env.GHRUNNER_HOME }}/.m2:/home/ubuntu/.m2 --env UID=${{ env.GHRUNNER_UID }} --env GID=${{ env.GHRUNNER_GID }}
93+ run : |
94+ id
95+ /entrypoint ./generate_protocols.sh
96+ - name : tycho linux_no_system_test build
97+ uses : addnab/docker-run-action@v3
98+ with :
99+ image : gemoc/gemoc-builder:latest
100+ options : -v ${{ github.workspace }}:/home/ubuntu/src -v ${{ env.GHRUNNER_HOME }}/.m2:/home/ubuntu/.m2 --env UID=${{ env.GHRUNNER_UID }} --env GID=${{ env.GHRUNNER_GID }}
101+ # first run as root and fix .m2 access right, then run as ubuntu via the entrypoint
102+ run : |
103+ chmod -R a+rw /home/ubuntu/.m2
104+ chown -R ${{ steps.vars.outputs.uid }}:${{ steps.vars.outputs.gid }} /home/ubuntu/.m2
105+ /entrypoint ./tycho_build.sh linux_no_system_test
106+
107+ - name : Publish Test Results
108+ 109+ if : always() # always run even if the previous step fails
110+ with :
111+ junit_files : " **/target/surefire-reports/TEST-*.xml"
112+
0 commit comments