-
Notifications
You must be signed in to change notification settings - Fork 163
116 lines (112 loc) · 3.6 KB
/
Copy pathmain.yml
File metadata and controls
116 lines (112 loc) · 3.6 KB
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
name: pyGIMLi CI
env:
SOURCE_DIR: source
on:
push:
branches:
- dev
- release
- 2.0beta
pull_request:
branches:
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-runner:
name: Choose runner
if: "!contains(github.event.head_commit.message, '[noci]')"
runs-on: self-hosted
outputs:
RUNNER: ${{ runner.name }}
steps:
- run: echo "Selected runner = ${{ runner.name }}"
pgcore:
name: Building pgcore & bindings
needs: get-runner
runs-on: ${{needs.get-runner.outputs.RUNNER}}
steps:
- name: Getting pyGIMLi sources
uses: actions/checkout@v6
with:
fetch-depth: 0 # checks out all branches and tags
path: source
- name: Cleaning old builds
run: bash ./$SOURCE_DIR/.workflow.sh clean
- name: Prepare build
run: bash ./$SOURCE_DIR/.workflow.sh build_pre
- name: Build libgimli
run: bash ./$SOURCE_DIR/.workflow.sh build
- name: Test bindings
run: bash ./$SOURCE_DIR/.workflow.sh build_post
tests:
name: Running tests
needs: [get-runner, pgcore]
runs-on: ${{needs.get-runner.outputs.RUNNER}}
env:
OPENBLAS_CORETYPE: "ARMV8" # current bug in OpenBlas core detection
steps:
- name: Prepare tests
run: bash ./$SOURCE_DIR/.workflow.sh test_pre
- name: Run pg.test()
run: bash ./$SOURCE_DIR/.workflow.sh test
docs:
name: Build website with examples
needs: [get-runner, pgcore]
runs-on: ${{needs.get-runner.outputs.RUNNER}}
env:
DISPLAY: ":99.0"
PYVISTA_OFF_SCREEN: True
OPENBLAS_CORETYPE: "ARMV8" # current bug in OpenBlas core detection
steps:
- name: Preparing doc build
run: bash ./$SOURCE_DIR/.workflow.sh doc_pre
- name: Running sphinx
run: bash ./$SOURCE_DIR/.workflow.sh doc
- name: Stage built website (release only)
if: github.ref == 'refs/heads/release'
run: |
rm -rf _site
mkdir _site
cp -R build-py*/doc/_build/html/. _site/
- name: Deploy to pygimli.org via FTP (release only)
if: github.ref == 'refs/heads/release'
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_URL }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PW }}
local-dir: ./_site/
merging:
name: Automerging
needs: [get-runner,tests,docs]
runs-on: ${{needs.get-runner.outputs.RUNNER}}
if: github.ref == 'refs/heads/dev' # Only merge from dev
steps:
- name: Merge dev -> main (with rebase)
working-directory: source
run: |
# Authorize with personal access token
echo "config"
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
echo "remote"
git remote set-url origin https://florian-wagner:${{ secrets.SECRET }}@github.com/gimli-org/pyGIMLi.git
# Make sure to be in sync with dev on remote
echo "dev status"
git status
echo "main status"
git checkout main
git status
echo "merge"
git merge dev --ff-only
git push origin HEAD:main
upload-html:
name: Upload HTML to dev.pygimli.org
runs-on: pgserver
needs: [tests,docs]
if: github.ref == 'refs/heads/dev' # Only merge from dev
steps:
- name: Uploading built html files
run: bash ./$SOURCE_DIR/.workflow.sh doc_post