Skip to content

Commit 1b377b6

Browse files
authored
Create build.yml
1 parent 3f407d9 commit 1b377b6

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow will:
2+
# - compile game on windows, linux, macos
3+
# - run game sonar on linux
4+
5+
name: Build
6+
7+
on:
8+
push:
9+
branches: [ master ]
10+
pull_request:
11+
branches: [ master ]
12+
13+
jobs:
14+
build:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
jdk: [17]
20+
runs-on: ${{ matrix.os }}
21+
env:
22+
JDK_VERSION: ${{ matrix.jdk }}
23+
AUDIODEV: "null"
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4.1.1
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Cache
32+
uses: actions/cache@v3.3.2
33+
with:
34+
path: ~/.m2/repository
35+
key: maven-${{ matrix.os }}-java${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }}
36+
restore-keys: |
37+
maven-${{ matrix.os }}-java${{ matrix.jdk }}-
38+
maven-${{ matrix.os }}-
39+
40+
- name: Maven
41+
uses: stCarolas/setup-maven@v4.5
42+
with:
43+
maven-version: 3.9.6
44+
45+
- name: JDK
46+
uses: actions/setup-java@v4.0.0
47+
with:
48+
java-version: |
49+
${{ matrix.jdk }}
50+
distribution: 'temurin'
51+
mvn-toolchain-id: |
52+
JavaSE-17
53+
54+
- name: Compile windows
55+
if: matrix.os == 'windows-latest'
56+
uses: coactions/setup-xvfb@v1.0.1
57+
with:
58+
run: mvn clean install --file tyrian-parent/pom.xml -U -Pall
59+
60+
- name: Compile macos
61+
if: matrix.os == 'macos-latest'
62+
uses: coactions/setup-xvfb@v1.0.1
63+
with:
64+
run: mvn clean install --file tyrian-parent/pom.xml -U -Pall
65+
66+
- name: Sonar ubuntu
67+
if: matrix.os == 'ubuntu-latest'
68+
uses: coactions/setup-xvfb@v1.0.1
69+
with:
70+
run: mvn clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --file tyrian-parent/pom.xml -U -Pall -Dsonar.organization=b3dgs -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=${{ secrets.SONAR_TOKEN }} -Dsonar.projectKey=b3dgs_tyrian-remake

0 commit comments

Comments
 (0)