-
Notifications
You must be signed in to change notification settings - Fork 54
99 lines (88 loc) · 3.86 KB
/
mcxtrace-autobuild.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
name: mcxtrace-autobuild
on:
schedule:
- cron: '50 23 * * *' # 23:50 every day
workflow_dispatch:
inputs:
manual-debugging:
type: boolean
description: Launch manual debugging tmate for inspection (automatic in case of errors)
default: false
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.11' }
- { os: macos-latest, CC: clang, CXX: clang++, python: "3.11" }
name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }}
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: McCode
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Setup build-deps
id: setup-build-deps
run: |
if [ "$RUNNER_OS" == "Linux" ]; then sudo apt-get update && sudo apt-get -y install equivs ; fi
if [ "$RUNNER_OS" == "Linux" ]; then sudo apt-get -y install xvfb mingw-w64 gfortran-mingw-w64 mingw-w64-x86-64-dev libz-mingw-w64-dev dos2unix nsis wine64; fi
if [ "$RUNNER_OS" == "Linux" ]; then sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install wine32; fi
( if [ "$RUNNER_OS" == "Linux" ]; then Xvfb :0 -screen 0 1024x768x16 ; fi ) &
if [ "$RUNNER_OS" == "Linux" ]; then mkdir /tmp/innosetup && cd /tmp/innosetup && wget https://jrsoftware.org/download.php/is.exe && DISPLAY=:0 wine ./is.exe /SP- /VERYSILENT /ALLUSERS /SUPPRESSMSGBOXES /DOWNLOADISCRYPT=1 ; fi
if [ "$RUNNER_OS" == "Linux" ]; then killall -9 Xvfb ; fi
- name: Check versions
id: version-checks
run: |
which python3
python3 --version
which cmake
cmake --version
#NB: bison and flex in path are actually too old, on mac we
#inject these via a brew keg later
- name: Build McXtrace
id: mcxtrace-build
run: |
if [ "$RUNNER_OS" == "macOS" ]; then export SDKROOT=$(xcrun --sdk macosx --show-sdk-path); fi
set -e
set -u
set -x
cd McCode
export REV=`git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags origin 'v*.*.*' | tail -1 | cut -f3 -d/ | cut -f2 -dv`
if [ "$RUNNER_OS" == "macOS" ]; then ./buildscripts/build_macos_mcxtrace ${REV}; fi
if [ "$RUNNER_OS" == "Linux" ]; then ./buildscripts/build_debs_mcxtrace ${REV} meta; fi
tar cfz dist-${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }}.tgz dist/
- name: Cross-Build McXtrace for windows
id: mcxtrace-mingw-build
run: |
set -e
set -u
set -x
cd McCode
export REV=`git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags origin 'v*.*.*' | tail -1 | cut -f3 -d/ | cut -f2 -dv`
if [ "$RUNNER_OS" == "Linux" ]; then rm -rf dist; fi
if [ "$RUNNER_OS" == "Linux" ]; then ./buildscripts/build_windows_mcxtrace ${REV}; fi
if [ "$RUNNER_OS" == "Linux" ]; then tar cfz dist-Windows.mingw64.python-${{ matrix.python }}.tgz dist/; fi
- name: 'Upload Artifact'
id: tar-upload
uses: actions/upload-artifact@v4
if: always()
with:
name: mcxtrace-artefacts-${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }}
path: "McCode/dist-*.tgz"
- name: Setup tmate session for manual debugging
uses: mxschmitt/action-tmate@v3
if: always() && (inputs.manual-debugging == true && steps.tar-package.outcome != 'success')
with:
limit-access-to-actor: true