-
Notifications
You must be signed in to change notification settings - Fork 47
125 lines (101 loc) · 3.99 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
---
# 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:
fail-fast: false # continue executing other checks if one fails
matrix:
python-version:
- '3.6.8' # slc7, slc8 and cs8 containers
- '3.8.10' # ubuntu2004 container
- '3.9.16' # slc9 container
- '3.10.6' # ubuntu2204 container
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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: mac-python${{ matrix.python-version }}
runs-on: macos-latest
strategy:
fail-fast: false # continue executing other checks if one fails
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 sapling
python3 -m pip install --upgrade tox tox-gh-actions coverage
- name: Run tests
run: tox -e darwin
- 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