26
26
include :
27
27
- name : Qt 5 / Linux x86_64
28
28
os : ubuntu-latest
29
- # XXX: --privileged is sort of a brute-force solution to get FUSE
30
- # working inside Docker, however so far I haven’t been able to
31
- # figure out precisely *which* privileges are needed.
32
- container : { image: "ubuntu:16.04", options: --privileged }
29
+ container : " ubuntu:16.04"
33
30
qt : 5
34
- env :
35
- ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
36
31
- name : Qt 5 / macOS x86_64
37
32
os : macos-13
38
33
container :
53
48
qt : 5
54
49
- name : Qt 6 / Linux x86_64
55
50
os : ubuntu-latest
56
- # XXX: --privileged is sort of a brute-force solution to get FUSE
57
- # working inside Docker, however so far I haven’t been able to
58
- # figure out precisely *which* privileges are needed.
59
- container : { image: "ubuntu:22.04", options: --privileged }
51
+ container : " ubuntu:22.04"
60
52
qt : 6
61
53
- name : Qt 6 / macOS x86_64
62
54
os : macos-13
@@ -74,21 +66,24 @@ jobs:
74
66
75
67
name : ${{matrix.name}}
76
68
runs-on : ${{matrix.os}}
77
- container : ${{matrix.container}}
78
- env : {ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true}
69
+ env : { CONTAINER: "${{matrix.container}}", BUILD_CMD: "" }
79
70
steps :
80
- - name : Install git (Linux)
81
- # GitHub runners come with git pre-installed, but our "custom" Linux
82
- # container image does not
83
- if : runner.os == 'Linux'
84
- run : |
85
- apt-get update -yq
86
- apt-get -yq install software-properties-common
87
- apt-add-repository -y ppa:git-core/ppa
88
- apt-get update -yq
89
- apt-get install -yq --no-install-suggests --no-install-recommends git
90
71
- name : Check out repository
91
72
uses : actions/checkout@v3
73
+ - name : Set up container (Linux)
74
+ if : runner.os == 'Linux'
75
+ # XXX: --privileged is sort of a brute-force solution to get FUSE
76
+ # working inside Docker, however so far I haven’t been able to
77
+ # figure out precisely *which* privileges are needed.
78
+ run : |
79
+ ls -l "${{github.workspace}}"
80
+ touch "${{github.workspace}}/env"
81
+ ls -l "${{github.workspace}}"
82
+ docker run --detach --privileged --workdir /workspace --volume "${{github.workspace}}:/workspace" --name "ci_${{github.sha}}" --entrypoint "tail" "${{matrix.container}}" -f /dev/null
83
+ file "${{github.workspace}}/env"
84
+ cat "${{github.workspace}}/env"
85
+ echo 'BUILD_CMD=docker exec --env-file "${{github.workspace}}/env" "ci_${{github.sha}}"' >> "${GITHUB_ENV}"
86
+ ls -l "${{github.workspace}}"
92
87
- name : Install dependencies
93
88
uses : ./.github/actions/install-dependencies
94
89
with :
@@ -101,18 +96,16 @@ jobs:
101
96
arch : ${{matrix.arch}}
102
97
103
98
- name : Configure build
104
- run : mkdir build; ${{runner.os == 'Linux' && matrix.qt == 6 && 'qmake6' || 'qmake'}}
99
+ run : ${BUILD_CMD} mkdir build; ${BUILD_CMD} ${{runner.os == 'Linux' && matrix.qt == 6 && 'qmake6' || 'qmake'}}
105
100
-o build PREFIX=/usr CONFIG-=debug_and_release CONFIG+=release CONFIG+=GIT
106
101
CONFIG+=PENCIL2D_${{ startsWith(github.ref, 'refs/heads/release/') && 'RELEASE' || 'NIGHTLY' }}
107
102
VERSION=${{ env.VERSION_NUMBER }}
108
103
109
104
- name : Build Pencil2D
110
- working-directory : build
111
- run : ${{runner.os != 'Windows' && 'make' || 'nmake'}}
105
+ run : ${{runner.os != 'Windows' && '${BUILD_CMD} make -C build' || 'cd build; nmake'}}
112
106
113
107
- name : Run tests
114
- env : { QT_QPA_PLATFORM: minimal }
115
- run : build/tests/tests
108
+ run : ${BUILD_CMD} QT_QPA_PLATFORM=minimal build/tests/tests
116
109
117
110
- name : Create package
118
111
id : package
@@ -131,3 +124,7 @@ jobs:
131
124
- name : Generate summary
132
125
shell : bash
133
126
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}"
127
+
128
+ - name : Stop container (Linux)
129
+ if : runner.os == 'Linux'
130
+ run : docker stop "ci_{{github.sha}}"
0 commit comments