-
Notifications
You must be signed in to change notification settings - Fork 55
123 lines (114 loc) · 3.42 KB
/
tests-macos.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
# name: tests-macos
# on:
# push:
# branches: [main]
# pull_request:
# branches: [main]
# workflow_dispatch:
# jobs:
# tests:
# name: '${{ matrix.os }}:python-${{ matrix.python-version }}'
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [macos-11, macos-12, macos-13]
# python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
# fail-fast: false
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Set up Python
# id: setup_python
# uses: actions/setup-python@v4
# with:
# activate-environment: vplanet
# environment-file: environment.yml
# python-version: ${{ matrix.python-version }}
# - name: Install
# id: install
# if: steps.setup_python.outcome == 'success'
# shell: bash -l {0}
# run: |
# python3 -m pip install -U pip
# python3 -m pip install -e .
# python3 -m pip install pytest pytest-cov
# - name: Run tests and generate coverage
# if: steps.install.outcome == 'success'
# shell: bash -l {0}
# run: |
# make test
# - name: Get unique id
# uses: Tiryoh/gha-jobid-action@v1
# id: jobs
# - name: Publish unit test results
# uses: EnricoMi/publish-unit-test-result-action/composite@v2
# if: always()
# with:
# files: |
# test-results/**/*.xml
# test-results/**/*.trx
# test-results/**/*.json
name: tests-macos
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
tests:
name: '${{ matrix.os }}:python-${{ matrix.python-version }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12, macos-13]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
id: setup_python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: steps.setup_python.outcome == 'success'
run: |
python -m pip install -U pip
python -m pip install -e .
python -m pip install pytest pytest-cov
- name: Run tests and generate coverage
if: steps.setup_python.outcome == 'success'
run: |
make test
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: test-results
- name: Download test results
uses: actions/download-artifact@v2
with:
name: test-results
- name: Check test results and fail if tests failed
run: |
# Check if there are any test failures (you might need to adjust this)
if grep -q "<failure" test-results/**/*.xml; then
echo "Tests failed."
exit 1
fi
shell: bash
- name: Get unique id
uses: Tiryoh/gha-jobid-action@v1
id: jobs
- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
files: |
test-results/**/*.xml
test-results/**/*.trx
test-results/**/*.json