-
Notifications
You must be signed in to change notification settings - Fork 46
138 lines (111 loc) · 4.07 KB
/
pr-check.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
---
# This workflow will install Python dependencies, run tests and lint with a
# variety of Python versions. For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Check PR
'on':
push:
branches:
- master
pull_request:
branches:
- master
permissions: {}
jobs:
unittest:
name: python${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- '3.6.8' # slc7, slc8 and cs8 containers
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
sudo apt update -y
sudo apt install -y curl libcurl4-gnutls-dev build-essential gfortran libmysqlclient-dev xorg-dev libglu1-mesa-dev libfftw3-dev libxml2-dev git unzip autoconf automake autopoint texinfo gettext libtool libtool-bin pkg-config bison flex libperl-dev libbz2-dev swig liblzma-dev libnanomsg-dev rsync lsb-release unzip environment-modules libglfw3-dev libtbb-dev python3-venv libncurses-dev environment-modules libxml2-dev libxslt1-dev
python -m pip install --upgrade tox tox-gh-actions coverage
- name: Run tests
run: tox
- name: Convert coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
run: |
coverage combine .tox/coverage.*
# Codecov only understands XML, JSON and LCOV files.
# Apparently, patching os.readlink in unit tests interferes with
# finding some source files, but our source shouldn't be affected, so
# ignore these errors.
coverage json --ignore-errors -o coverage.json
- name: Upload coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
uses: codecov/codecov-action@v3
with:
files: coverage.json
mac-unittest:
name: python${{ matrix.python-version }}
runs-on: macos-latest
strategy:
matrix:
python-version:
- '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
brew install modules alisw/system-deps/o2-full-deps
python -m pip install --upgrade tox tox-gh-actions coverage
- name: Run tests
run: tox
- name: Convert coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
run: |
coverage combine .tox/coverage.*
# Codecov only understands XML, JSON and LCOV files.
# Apparently, patching os.readlink in unit tests interferes with
# finding some source files, but our source shouldn't be affected, so
# ignore these errors.
coverage json --ignore-errors -o coverage.json
- name: Upload coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
uses: codecov/codecov-action@v3
with:
files: coverage.json
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: python -m pip install --upgrade tox tox-gh-actions
- name: Run linters
run: tox -e lint
documentation:
name: documentation
runs-on: ubuntu-latest
container:
image: jekyll/jekyll
steps:
- uses: actions/checkout@v3
- name: Test documentation
run: |
chmod -R a+rwX .
jekyll build -s docs -d _site --baseurl .
script/custom_htmlproofer.rb