forked from dearlight/Corruption-of-Champions
-
Notifications
You must be signed in to change notification settings - Fork 97
84 lines (70 loc) · 3 KB
/
ant.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
# This workflow will build a Java project with Ant
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant
name: ActionScript 3 CI
# Github worflows do not support actionscript directly.
# However the build uses ant, which is usually used to build java projects.
# The ant task (mxmlc) provided by the flex SDK (ant/lib/flexTasks.jar) is used to build the project.
on:
push:
# Just so the CI won't complain about Vanilla+ failing, since V+ isn't configured for CI.
branches-ignore: [ VanillaPlus ]
pull_request:
branches: [ master ]
env:
# tell the build file where to find the flex SDK
FLEX_HOME: "build-dep/bin/flex/"
# this is to trick the flash player into thinking it is running on a desktop
DISPLAY: ":1"
jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
# different configurations that should be built
build: [ release, debug ]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# install VNC and xfce4 so we have a desktop, as the flash player requires one:
- name: Install desktop
run: sudo apt-get install vnc4server xfce4 ant ant-optional -y
# So flexunit can find the player and the ant build file does not have to be modified
- name: Copy flashplayer to correct location
run: sudo cp build-dep/bin/flashplayer /usr/local/bin/gflashplayer
# start a VNC session, this will be the desktop for tests
- name: Start VNC
run: Xvnc :1 &
# this is where the build happens. A separate build is started for every entry in the matrix element
- name: Build and run tests
run: ant test-${{ matrix.build }}
# Run sonar scan if a build on master succeeds. This generates project code quality stats and lists possible issues
sonarcloud:
if: ${{ github.ref == 'refs/heads/master' }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Update CoC version in sonar configuration
run: devTools/ci/update-sonar-version.sh
- name: SonarCloud Scan
continue-on-error: true
uses: sonarsource/sonarcloud-github-action@master
with:
# The value for SONAR_ORG can be found in sonarcloud > my organisations > copy the key for the org you wish to use
# This needs to be set in the Github repository. Repository settings > secrets > new secret
args: >
-Dsonar.organization=${{ secrets.SONAR_ORG }}
env:
# Provided by Github
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This token can be created on sonarcloud My Account > Security tab > Generate
# This needs to be set in the Github repository. Repository settings > secrets > new secret
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}