forked from flagarde/YAODAQ
-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (141 loc) · 4.26 KB
/
Windows-M2sys.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Windows M2sys ROOT
on:
push:
pull_request:
schedule:
#Every Sunday at midnight
- cron: '0 0 * * 0'
env:
CMAKE_VERSION: 3.16.x
NINJA_VERSION: 1.10.2
BUILD_TYPE: Release
artifact: "Windows-M2sys.tar.xz"
INSTALL_ROOT: TRUE
ROOT_VERSION: "6.24.00"
ROOT_URL: "https://root.cern/download"
jobs:
# Checkout apply clang-format and upload artifact
format:
name: "Format"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use clang-format
uses: DoozyX/[email protected]
with:
source: '.'
clangFormatVersion: 11
inplace: True
- name: Setup Python
uses: actions/setup-python@v2
- name: Install cmakelang
uses: BSFishy/pip-action@v1
with:
packages: cmakelang pyyaml jinja2
- name: Use cmake-format
run: find . \( -name '*.cmake' -o -name 'CMakeLists.txt' \) -exec cmake-format -i {} \;
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: clang-format
path: ${{ github.workspace }}
build:
needs: format
name: "Build"
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/download-artifact@v2
with:
name: clang-format
- name: Cache ROOT
if: env.INSTALL_ROOT == 'TRUE'
id: root-compile
uses: actions/cache@v2
with:
path: ./root ./build-root ./root-install
key: root-compile
- name: Install msys2
uses: msys2/setup-msys2@v2
with:
path-type: minimal
release: true
update: true
install: git mingw-w64-x86_64-toolchain ccache ninja cmake gcc make llvm python git
- name: Download and unzip ROOT
if: steps.root-compile.outputs.cache-hit != 'true' && env.INSTALL_ROOT == 'TRUE'
shell: cmake -P {0}
run: |
set(ROOT_URL "$ENV{ROOT_URL}/root_v$ENV{ROOT_VERSION}.Linux-ubuntu20-x86_64-gcc9.3.tar.gz")
file(DOWNLOAD "${ROOT_URL}" ./root.zip)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./root.zip)
- name: Configure
working-directory: ${{ github.workspace }}
run: bash ./root/bin/thisroot.sh ; cmake -S . -G Ninja -B build -D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DROOT_DIR=./root/cmake
- name: Build
run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel 2
- name: Run tests
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ env.BUILD_TYPE }} -j2 -VV --output-on-failure
- name: Install Strip
run: cmake --install build --prefix instdir --strip
release:
name: "Release"
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
needs: build
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Store Release url
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
- name: Pack
working-directory: instdir
run: cmake -E tar cJfv ../${{ env.artifact }} .
- name: Upload
uses: actions/upload-artifact@v2
with:
path: instdir
name: ${{ env.artifact }}
publish:
if: contains(github.ref, 'tags/v')
name: "Publish"
runs-on: ubuntu-latest
needs: release
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: ${{ env.artifact }}
path: ./
- name: Download URL
uses: actions/download-artifact@v1
with:
name: upload_url
path: ./
- id: set_upload_url
run: |
upload_url=`cat ./upload_url`
echo ::set-output name=upload_url::$upload_url
- name: Upload to Release
id: upload_to_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
asset_path: ./${{ env.artifact }}
asset_name: ${{ env.artifact }}
asset_content_type: application/x-gtar