-
Notifications
You must be signed in to change notification settings - Fork 95
134 lines (134 loc) · 4.59 KB
/
build-asy-main.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
134
name: build-asy-cxx
on:
workflow_dispatch:
pull_request:
branches:
- "master"
- "a/*"
push:
branches:
- msvc-*
jobs:
configure-linux-release-x64:
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- run: |
VCPKG_ROOT="$VCPKG_INSTALLATION_ROOT" \
cmake --preset linux/release
- name: tar+gz cmake configuration
run: tar -czf cmake-linux-cfg-artifact.tar.gz --exclude='vcpkg_installed' cmake-build-linux/release
- name: Upload configuration artifacts
uses: actions/upload-artifact@v3
with:
name: cmake-linux-x64-release-cfg-tgz
path: cmake-linux-cfg-artifact.tar.gz
build-linux-release-x64:
needs: configure-linux-release-x64
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- name: Download configuration artifacts
uses: actions/download-artifact@v3
with:
name: cmake-linux-x64-release-cfg-tgz
- name: Untar configuration artifact
run: tar -xzf cmake-linux-cfg-artifact.tar.gz
# Why we are defining version here and not in configuration stage is because cmake gets
# re-run here
- name: Generate version suffix
run: |
echo set\(ASY_VERSION_SUFFIX \"/github-ci/ref=${{ github.sha }}\"\) > asy-pkg-version-suffix.cmake
- run: cmake --build --preset linux/release --target asy-with-basefiles -j
- name: Archive build files
uses: actions/upload-artifact@v3
with:
name: asy-buildfiles
path: |
cmake-build-linux/release/asy
cmake-build-linux/release/base
- name: Build Asymptote google test files
run: cmake --build --preset linux/release --target asyCxxTests -j
- name: Archive Asymptote gtest files
uses: actions/upload-artifact@v3
with:
name: asy-gtest-files
path: |
cmake-build-linux/release/cxxtests/asyCxxTests
cmake-build-linux/release/cxxtests/*.cmake
- name: Archive Asymptote test files
uses: actions/upload-artifact@v3
with:
name: asy-testfiles
path: cmake-build-linux/release/CTest*.cmake
test-x64-cxxtests:
needs: build-linux-release-x64
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- name: Download test artifacts
uses: actions/download-artifact@v3
with:
name: asy-testfiles
path: cmake-build-linux/release/
- name: Download artifacts for gtest
uses: actions/download-artifact@v3
with:
name: asy-gtest-files
path: cmake-build-linux/release/cxxtests
- run: chmod +x cmake-build-linux/release/cxxtests/asyCxxTests
- name: google test
run: ctest --test-dir cmake-build-linux/release -R "^cxxtests."
test-x64-asy-tests:
needs: build-linux-release-x64
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: asy-buildfiles
path: cmake-build-linux/release/
- name: Download test artifacts
uses: actions/download-artifact@v3
with:
name: asy-testfiles
path: cmake-build-linux/release/
- run: chmod +x cmake-build-linux/release/asy
- name: asy test
run: ctest --test-dir cmake-build-linux/release -R "^asy.*" -E "asy.(gc.*|pic.trans)"
package-asymptote-artifacts:
needs: [test-x64-cxxtests, test-x64-asy-tests]
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: asy-buildfiles
path: tar-stage
- name: Link examples directory to tar-stage
run: ln -sf ${{ github.workspace }}/examples ${{ github.workspace }}/tar-stage/examples
- name: Set asy's +x flag
run: chmod +x tar-stage/asy
- name: tar package
run: tar -C tar-stage -cvhf asymptote-build-linux.tar asy base examples
- name: Archive Asymptote test files
uses: actions/upload-artifact@v3
with:
name: asymptote-build-linux
path: asymptote-build-linux.tar