-
Notifications
You must be signed in to change notification settings - Fork 17
56 lines (51 loc) · 2.07 KB
/
process-pull-request.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
name: Run pytest
on:
pull_request:
branches: [ main, dev ]
env:
MY_REF: ${{ format('refs/heads/{0}', github.event.pull_request.head.ref) }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PYTHONIOENCODING: utf-8
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ["3.8", "3.10"]
os: [ubuntu-latest, macos-latest]
steps:
- name: Check if relevant files have changed
uses: actions/github-script@0.9.0
id: service-changed
with:
result-encoding: string
script: |
const result = await github.pulls.listFiles({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.number,
per_page: 100
})
const serviceChanged = result.data.filter(f => f.filename.startsWith("proteinflow/")).length > 0
console.log(serviceChanged)
return serviceChanged
- uses: actions/checkout@v3
if: ${{ steps.service-changed.outputs.result == 'true' }}
with:
ref: ${{ env.MY_REF }}
fetch-depth: 0
- name: Install dependencies
if: ${{ steps.service-changed.outputs.result == 'true' }}
run: |
conda update conda -y
conda create --name proteinflow -y python=${{ matrix.version }}
conda install -n proteinflow -c conda-forge -c bioconda mmseqs2
conda run -n proteinflow python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
conda run -n proteinflow python -m pip install awscli pytest flake8
conda run -n proteinflow python -m pip install numpy
conda run -n proteinflow python -m pip install "rcsbsearch @ git+https://github.com/sbliven/rcsbsearch@dbdfe3880cc88b0ce57163987db613d579400c8e"
conda run -n proteinflow python -m pip install -e .
- name: Test with pytest
if: ${{ steps.service-changed.outputs.result == 'true' }}
run: |
conda run -n proteinflow pytest tests