-
Notifications
You must be signed in to change notification settings - Fork 3.2k
112 lines (100 loc) · 3.61 KB
/
Copy pathbuild_wasm.yml
File metadata and controls
112 lines (100 loc) · 3.61 KB
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
110
111
112
name: 'Build: Wasm'
on:
# pull_request: At the moment disabled for pull_request
workflow_dispatch:
inputs:
build_mode:
description: 'Build mode: devel, nightly, testing, stable'
default: 'devel'
required: true
workflow_call:
inputs:
build_mode:
description: 'Build mode: devel, nightly, testing, stable'
default: 'devel'
type: string
required: true
concurrency:
# If run via workflow_call, ${{ github.workflow }} is the root workflow's name (e.g. 'Deploy'),
# which is the same for all workflows called in that run, hence we must add a unique suffix here.
group: ${{ github.workflow }} ${{ github.event_name }} ${{ github.ref }} wasm
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v7
with:
submodules: recursive
- name: Configure workflow
env:
pull_request_title: ${{ github.event.pull_request.title }}
run: |
bash ./buildscripts/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ inputs.build_mode }}
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env)
bash ./buildscripts/ci/tools/make_build_number.sh
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
ADD_INFO="_${GITHUB_REF#refs/heads/}"
if [ "${{ github.event_name }}" == "pull_request" ]; then
ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"
fi
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Wasm${ADD_INFO}")"
echo "github.repository: ${{ github.repository }}"
echo "BUILD_MODE=$BUILD_MODE" | tee -a $GITHUB_ENV
echo "BUILD_NUMBER=$BUILD_NUMBER" | tee -a $GITHUB_ENV
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" | tee -a $GITHUB_ENV
- parallel:
- name: Restore ccache files
id: restore-ccache
uses: actions/cache/restore@v6
with:
path: ${{ github.workspace }}/.ccache
key: wasm-ccache-
restore-keys: wasm-ccache-
- name: Setup ccache
run: |
sudo apt-get install -y ccache
bash ./buildscripts/ci/tools/setup_ccache_config.sh
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.2
host: all_os
target: 'wasm'
arch: wasm_singlethread
modules: 'qt5compat qtshadertools'
cache: true
- name: Setup environment
run: |
bash ./buildscripts/ci/linux/setup.sh --arch wasm
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem_matchers/gcc.json"
- name: Build
env:
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}
run: |
bash ./buildscripts/ci/wasm/build.sh -n ${{ env.BUILD_NUMBER }}
- name: Show ccache stats
run: |
ccache -sv
- name: Package
run: |
bash ./buildscripts/ci/wasm/package.sh
- name: Upload artifacts on GitHub
uses: actions/upload-artifact@v7
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ./build.artifacts/
- name: Prepare ccache files for saving
id: prepare-save-ccache
if: always()
run: |
ccache --recompress 10
echo "CCACHE_TIMESTAMP=$(date -u +"%F-%T")" | tee -a $GITHUB_OUTPUT
- name: Save ccache files
if: always()
uses: actions/cache/save@v6
with:
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}${{ steps.prepare-save-ccache.outputs.CCACHE_TIMESTAMP }}
path: ${{ github.workspace }}/.ccache