-
Notifications
You must be signed in to change notification settings - Fork 12
65 lines (51 loc) · 1.95 KB
/
continous-integration.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
##################################################################################################
# @Date: May 9th 2024
# @Author: Patrick
# @Email: pinyuan.li@emory.edu
# @Description: This workflow will automatically run pytest
##################################################################################################
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniconda-version: "latest"
channels: anaconda
channel-priority: true
- name: Create conda environment
run: conda env create -f devtools/conda-envs/environment.yml
- name: Activate conda environment
shell: bash -l {0}
run: conda activate autosolvate
- name: Install additional dependencies if needed
run: conda install --yes flake8 pytest
- name: Create test reports directory
run: mkdir -p test-reports
- name: Test with pytest
run: conda run -n autosolvate pytest --junitxml=test-reports/results.xml
- name: Show test-reports directory contents
run: |
echo "Content of test-reports directory:"
ls -la test-reports/
- name: Show pytest results
run: |
if [ -f test-reports/results.xml ]; then
cat test-reports/results.xml
else
echo "results.xml not found"
fi
- name: Upload Test Reports
uses: actions/upload-artifact@v3
with:
name: test-reports
path: test-reports/results.xml