Build Validation #1835
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |