forked from musescore/MuseScore
-
-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (102 loc) · 3.52 KB
/
ci_linux.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
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
name: CI_Linux
on:
push:
branches:
- 3.x
pull_request:
branches:
- 3.x
schedule:
- cron: '0 4 */1 * *' # At 04:00 on every day-of-month
workflow_dispatch:
inputs:
build_mode:
description: 'Build mode: devel_build, nightly_build, testing_build, stable_build'
required: true
default: 'devel_build'
publish:
description: 'Publish to FTP: on - publish'
required: false
default: 'off'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Clone repository
uses: actions/checkout@v3
- name: "Configure workflow"
run: |
sudo bash ./build/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ github.event.inputs.build_mode }}
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env)
DO_BUILD='true'
DO_PUBLISH='false'
if [[ "${{ github.event.inputs.publish }}" == "on" || "$BUILD_MODE" == "nightly_build" ]]; then
DO_PUBLISH='true'
if [ -z "${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }}" ]; then
echo "warning: not set OSUOSL_SSH_ENCRYPT_SECRET, publish disabled"
DO_PUBLISH='false'
fi
fi
echo "BUILD_MODE=$BUILD_MODE" >> $GITHUB_ENV
echo "BUILD_MODE: $BUILD_MODE"
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
echo "DO_PUBLISH=$DO_PUBLISH" >> $GITHUB_ENV
echo "DO_PUBLISH: $DO_PUBLISH"
- name: Setup environment
if: env.DO_BUILD == 'true'
run: |
sudo bash ./build/ci/linux/setup.sh
- name: Build
if: env.DO_BUILD == 'true'
run: |
T_ID=${{ secrets.TELEMETRY_TRACK_ID }}; if [ -z "$T_ID" ]; then T_ID="''"; fi
sudo bash ./build/ci/linux/build.sh -n ${{ github.run_id }} --telemetry $T_ID
- name: Package
if: env.DO_BUILD == 'true'
run: |
sudo bash ./build/ci/linux/package.sh
- name: Checksum
if: env.DO_BUILD == 'true'
run: |
sudo bash ./build/ci/tools/checksum.sh
- name: Publish package
if: env.DO_PUBLISH == 'true'
run: |
sudo bash ./build/ci/tools/osuosl/publish.sh -s ${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }} --os linux -v 3
- name: Upload artifacts on GitHub
if: env.DO_BUILD == 'true'
uses: actions/upload-artifact@v3
with:
name: MuseScore_${{ github.run_id }}
path: ./build.artifacts/
run_mtests:
runs-on: ubuntu-20.04
env:
# Enable AddressSanitizer in the mtest build
CFLAGS: "-fsanitize=address -fno-omit-frame-pointer"
CXXFLAGS: "-fsanitize=address -fno-omit-frame-pointer"
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Setup environment
run: |
sudo bash ./build/ci/linux/setup.sh
- name: Build
run: |
mkdir -p build.artifacts/env
#sudo bash ./build/ci/linux/build.sh -n ${{ github.run_id }} --build_mode mtests
./build/ci/linux/build.sh -n ${{ github.run_id }} --build_mode mtests
- name: Run mtests
run: |
# At moment build and run mtests consume 13.4 Gb of the disk.
# After left too little free space.
# So, we remove unnecessary tools, for more free space
#sudo docker system prune -a -f
#sudo rm -rf /usr/local/lib/android
#sudo bash ./build/ci/linux/runmtests.sh
./build/ci/linux/runmtests.sh