-
Notifications
You must be signed in to change notification settings - Fork 18
132 lines (111 loc) · 3.96 KB
/
CI.yml
File metadata and controls
132 lines (111 loc) · 3.96 KB
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
126
127
128
129
130
131
132
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: "CI"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
push:
branches: [ "*" ]
pull_request:
types: [opened, ready_for_review]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-ci:
name: miniconda build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
env:
SETUPTOOLS_USE_DISTUTILS: stdlib
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test-environment
python-version: ${{ matrix.python-version }}
channels: bioconda,default,anaconda,r,conda-forge
allow-softlinks: true
channel-priority: 'flexible'
show-channel-urls: true
use-only-tar-bz2: true
auto-update-conda: true
- name: setup conda
run: |
conda config --set always_yes yes --set changeps1 no
conda info -a
conda list
conda config --show-sources
conda config --show
- name: Install dependencies
run: |
conda install mamba
mamba install pandas tzlocal rpy2 biopython ReportLab pytest-cov codecov bioconductor-deseq2 gfortran_linux-64 bioconductor-apeglm
- name: hack for missing sysconfigdata (py3.7 and py3.8, doing nothing really)
if: matrix.python-version != '3.6'
run: |
ls $CONDA_PREFIX/lib/python${{ matrix.python-version }}/_sysconfigdata_x86_64_conda*.py
- name: hack for missing sysconfigdata (py3.6)
if: matrix.python-version == '3.6'
run: |
ls $CONDA_PREFIX/lib/python${{ matrix.python-version }}/_sysconfigdata_x86_64*.py
cp $CONDA_PREFIX/lib/python${{ matrix.python-version }}/_sysconfigdata_x86_64_conda_cos6_linux_gnu.py $CONDA_PREFIX/lib/python${{ matrix.python-version }}/_sysconfigdata_x86_64_conda_linux_gnu.py
- name: install package
run: |
conda activate test-environment
pip install .
- name: install R packages
run: |
Rscript setup.R
- name: Test with pytest
run: |
coverage run -m pytest -vvv
- name: codecov
run: |
bash <(curl -s https://codecov.io/bash)
build-and-push-image:
runs-on: ubuntu-latest
needs: build-and-ci
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
if: github.ref_name == 'master'
uses: docker/build-push-action@v3
with:
context: .
push: true
target: diffexpr
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/diffexpr:${{ github.ref_name }}
${{ env.REGISTRY }}/${{ github.repository }}/diffexpr:${{ github.sha }}
- name: Build and push Dev Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
target: diffexpr_dev
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/diffexpr-dev:${{ github.ref_name }}
${{ env.REGISTRY }}/${{ github.repository }}/diffexpr-dev:${{ github.sha }}