-
Notifications
You must be signed in to change notification settings - Fork 23
76 lines (62 loc) · 2.49 KB
/
conda-build.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
name: Conda Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check version number consistency
shell: python {0}
run: |
"Compare the version numers from the package and the conda recipe."
# collect the package version
import sys
sys.path.append("/home/runner/work/sdrf-pipelines/sdrf-pipelines")
import sdrf_pipelines
package_version = sdrf_pipelines.__version__
# collect the version from the conda recipe
with open("./recipe/meta.yaml", encoding="utf-8") as f:
for line in f.readlines():
if line.startswith(" version: "):
recipe_version = line.lstrip(" version:").strip().strip('"')
break
if package_version == recipe_version:
print(f"The package and recipe versions are consistent: {package_version}")
else:
raise ValueError(
"ERROR: The versions are inconsistent."
f"\nVersion in ./sdrf_pipelines/__init__.py: {package_version}"
f"\nVersion in ./recipe/meta.yaml: {recipe_version}"
)
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: sdrf-pipelines
environment-file: environment.yml
auto-activate-base: false
auto-update-conda: true
python-version: '3.10'
channels: conda-forge,bioconda,defaults
- name: Install build dependencies
run: |
conda install conda-build conda-verify anaconda-client
- name: Build the sdrf-pipelines package
run: |
conda build --package-format .tar.bz2 recipe
- name: Install the package
run: |
PACKAGE_PATH=$(conda build --package-format .tar.bz2 --output recipe)
conda install --offline "$PACKAGE_PATH"
- name: Test install
run: |
parse_sdrf --help
- name: Test validation of SDRF file
run: |
parse_sdrf validate-sdrf --sdrf_file tests/data/reference/PDC000126/PDC000126.sdrf.tsv
- name: Test validation of SDRF file with cache only
run: |
parse_sdrf validate-sdrf --sdrf_file tests/data/reference/PDC000126/PDC000126.sdrf.tsv --use_ols_cache_only