-
Notifications
You must be signed in to change notification settings - Fork 8
90 lines (90 loc) · 3 KB
/
candig-testing.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Test-CanDIG-build
run-name: Build Validation
on:
push:
branches: [develop]
pull_request:
workflow_dispatch:
inputs:
module:
type: string
jobs:
Build-CanDIG:
runs-on: [ubuntu-latest]
defaults:
run:
shell: bash -l {0}
steps:
- name: Install conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
channels: conda-forge, defaults
use-only-tar-bz2: true
auto-update-conda: true
auto-activate-base: true
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup environment file
run: |
cp etc/env/example.env example.env
sed "s@CONDA_INSTALL=.*@CONDA_INSTALL=$CONDA@" example.env > .env
sed -i "s@KEEP_TEST_DATA=false@KEEP_TEST_DATA=true@" .env
- name: Display environment file
run: cat ".env"
- name: Add CanDIG local domain redirection to hosts
run: echo "::1 candig.docker.internal" | sudo tee -a /etc/hosts
- name: Install submodules
run: |
git submodule update --init --recursive
make mkdir
- name: Restore Conda environment cache
id: cache-conda
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}
key: ${{ runner.os }}-conda-${{ hashFiles('etc/venv/requirements.txt') }}
- name: Install CanDIG conda environment
if: ${{ steps.cache-conda.outputs.cache-hit != 'true' }}
id: install-conda
run: |
make init-conda
- name: Save Conda cache
uses: actions/cache/save@v4
if: steps.install-conda.outcome == 'success'
with:
path: ${{ env.CONDA }}
key: ${{ runner.os }}-conda-${{ hashFiles('etc/venv/requirements.txt') }}
- name: Build stack
run: |
conda activate candig
(yes || true) | make build-all
- name: Integration testing
run: |
conda activate candig
export CANDIG_DEBUG_MODE=1
make test-integration
- name: Save docker container logs
if: always()
run: ./print_logs.sh > tmp/container_logs.txt 2>&1
- name: Save any intermediate files in containers
if: always()
run: |
mkdir tmp/ingest
docker cp candigv2_candig-ingest_1:/home/candig/tmp tmp/ingest 2>&1
mkdir tmp/index
docker cp candigv2_htsget_1:/home/candig/tmp tmp/index 2>&1
- name: Save vault audit logs
if: always()
run: docker cp candigv2_vault-runner_1:/vault/vault-audit.log tmp/vault_audit.log 2>&1
- name: Save container and error logs as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: Post-build error log
path: |
tmp/progress.txt
tmp/container_logs.txt
tmp/vault_audit.log
tmp/ingest
tmp/index