-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.8 KB
/
python-app.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
name: Python package
on: [push, pull_request]
jobs:
test:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.12.3" # Specify the version of Python to use
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda-
- name: Install Miniconda
shell: bash
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
source "$HOME/miniconda/etc/profile.d/conda.sh"
conda config --set always_yes yes --set changeps1 no
conda config --add pkgs_dirs ~/conda_pkgs_dir
conda update -q conda
- name: Add conda channels
shell: bash
run: |
source "$HOME/miniconda/etc/profile.d/conda.sh"
conda config --add channels conda-forge
- name: Create and activate conda environment
shell: bash
run: |
source "$HOME/miniconda/etc/profile.d/conda.sh"
conda env create -f environment.yml
conda activate protein-prediction
env:
CONDA_PKGS_DIRS: ~/conda_pkgs_dir
- name: Check Python version
shell: bash
run: |
source "$HOME/miniconda/etc/profile.d/conda.sh"
conda activate protein-prediction
python --version
- name: Run tests
shell: bash
run: |
source "$HOME/miniconda/etc/profile.d/conda.sh"
conda activate protein-prediction
pytest