-
Notifications
You must be signed in to change notification settings - Fork 2
147 lines (137 loc) · 4.49 KB
/
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
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Imaris Extension Testing
on:
push:
branches:
- main
paths-ignore: # ignore auto-generated files, only run when source files change
- docs/*.html
tags:
- "v*.*.*"
pull_request:
branches:
- main
paths-ignore: # ignore auto-generated files, only run when source files change
- docs/*.html
# Enable manual running of workflow, so we can force execution
workflow_dispatch:
# run testing on the first of each month 5am ET / 9am UTC
schedule:
- cron: '0 9 1 * *'
jobs:
# linting and checking for secrets is only done once
# no need for multi platform/Python versions.
preliminary_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Run pre-commit tests
run: |
pip install pre-commit
pre-commit run --all-files
# run trufflehog3 with no-entropy because our testing code
# uses md5 hashes which are all high entropy
- name: Install and run trufflehog3 secrets scanner
run: |
python -m pip install trufflehog3
trufflehog3 -v --no-entropy . && echo "tufflehog3 secrets scan passed"
test:
# only run the code testing if linting and secrets passed
needs: preliminary_test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, "3.10"]
exclude: # macos-latest, 14, does not have Python 3.7, so workaround for now
- python-version: "3.7"
os: macos-latest
include: # Run Python 3.7 on older macos
- python-version: "3.7"
os: macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Create LFS file list
run: |
git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v4
id: lfs-cache
with:
path: .git/lfs
key: lfs-v1-${{ hashFiles('.lfs-assets-id') }}
restore-keys:
lfs-v1-
- name: Git LFS Pull
run: |
git lfs pull
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
#problems with package hashes when using new pip python -m pip install --upgrade pip
#python -m pip install pip==23.3.2
run: |
pip install -r requirements_dev.txt
- name: Test with pytest
run: |
python -m pytest
documentation:
# only run if this workflow was triggered by a push event on main branch
# either direct push to main or a merged pull request which also generates
# a push event.
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
# PySide6 import caused an ImportError: libEGL.so.1: cannot open shared object file: No such file or directory
# so installing libegl1-mesa-dev
run: |
sudo apt update
sudo apt install libegl1-mesa-dev
sudo apt install pandoc
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Update documentation
run: |
python docs/generate_documentation.py
ls -la docs
- name: Commit and push
shell: bash
run: | # Only run if the docs changed
if ! git diff --quiet *.html; then
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"
git add docs/*.html
git commit -m "Adding extension documentation."
git push
fi
github_release:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Prepare release notes
run: |
python .github/workflows/create_release_notes.py CHANGELOG.md ${{ github.ref_name }} release_notes.txt
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.txt