-
Notifications
You must be signed in to change notification settings - Fork 273
133 lines (124 loc) · 4.19 KB
/
ci.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build & Tests
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- '**.sh'
- '**.py'
- '**.ps1'
pull_request:
# Need to repeat these paths - YAML anchors aren’t supported on GHA atm
# (or any other CI service that I know of, for that matter)
paths-ignore:
- 'docs/**'
- '**.md'
- '**.sh'
- '**.py'
- '**.ps1'
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: Qt 5 / Linux x86_64
os: ubuntu-latest
# XXX: --privileged is sort of a brute-force solution to get FUSE
# working inside Docker, however so far I haven’t been able to
# figure out precisely *which* privileges are needed.
container: { image: "ubuntu:16.04", options: --privileged }
qt: 5
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
- name: Qt 5 / macOS x86_64
os: macos-12
container:
qt: 5
- name: Qt 5 / macOS arm64
os: macos-latest
container:
qt: 5
- name: Qt 5 / Windows x86
os: windows-2019
arch: win32_msvc2019
container:
qt: 5
- name: Qt 5 / Windows x86_64
os: windows-2019
arch: win64_msvc2019_64
container:
qt: 5
- name: Qt 6 / Linux x86_64
os: ubuntu-latest
# XXX: --privileged is sort of a brute-force solution to get FUSE
# working inside Docker, however so far I haven’t been able to
# figure out precisely *which* privileges are needed.
container: { image: "ubuntu:22.04", options: --privileged }
qt: 6
- name: Qt 6 / macOS x86_64
os: macos-12
container:
qt: 6
- name: Qt 6 / macOS arm64
os: macos-latest
container:
qt: 6
- name: Qt 6 / Windows x86_64
os: windows-2019
arch: win64_msvc2019_64
container:
qt: 6
name: ${{matrix.name}}
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
env: {ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true}
steps:
- name: Install git (Linux)
# GitHub runners come with git pre-installed, but our "custom" Linux
# container image does not
if: runner.os == 'Linux'
run: |
apt-get update -yq
apt-get -yq install software-properties-common
apt-add-repository -y ppa:git-core/ppa
apt-get update -yq
apt-get install -yq --no-install-suggests --no-install-recommends git
- name: Check out repository
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
arch: ${{matrix.arch}}
qt: ${{matrix.qt}}
- name: Set up environment
uses: ./.github/actions/setup-environment
with:
arch: ${{matrix.arch}}
- name: Configure build
run: mkdir build; ${{runner.os == 'Linux' && matrix.qt == 6 && 'qmake6' || 'qmake'}}
-o build PREFIX=/usr CONFIG-=debug_and_release CONFIG+=release CONFIG+=GIT
CONFIG+=PENCIL2D_${{ startsWith(github.ref, 'refs/heads/release/') && 'RELEASE' || 'NIGHTLY' }}
VERSION=${{ env.VERSION_NUMBER }}
- name: Build Pencil2D
working-directory: build
run: ${{runner.os != 'Windows' && 'make' || 'nmake'}}
- name: Run tests
env: { QT_QPA_PLATFORM: minimal }
run: build/tests/tests
- name: Create package
id: package
if: runner.os != 'Linux' || matrix.qt == 5
uses: ./.github/actions/create-package
with:
arch: ${{matrix.arch}}
qt: ${{matrix.qt}}
- name: Upload package
if: runner.os != 'Linux' || matrix.qt == 5
uses: actions/upload-artifact@v3
with:
name: ${{steps.package.outputs.output-basename}}
path: build/${{steps.package.outputs.output-basename}}*
- name: Generate summary
shell: bash
run: echo "Build will be available for download [here](https://get.pencil2d.org/@${{github.repository_owner}}/${{github.run_id}}/${{steps.package.outputs.output-basename}}) once the run is finished." > "${GITHUB_STEP_SUMMARY}"