Validate annotations #2393
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
# This workflow will install Python dependencies and run the included validation script. | |
name: Validate annotations | |
on: | |
push: | |
paths: | |
- 'annotated-projects/**' | |
- 'validate.py' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'annotated-projects/**' | |
- 'validate.py' | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
sdrf_proteomics_validations: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install git+https://github.com/bigbio/sdrf-pipelines | |
- name: Get a list of changed files | |
if: github.event_name != 'schedule' | |
id: getfiles | |
run: | | |
export OUTFILE=$HOME/filelist.txt | |
if [ "${{ github.event_name }}" == pull_request ]; then | |
echo 'Changed files:' | |
git diff-tree --no-commit-id --name-only -r origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }} | tee "$OUTFILE" | |
else | |
# push | |
if [ "${{ github.event.before }}" == "0000000000000000000000000000000000000000" ]; then | |
parent="origin/master" # compare with master as a last resort | |
else | |
parent="${{ github.event.before }}" | |
fi | |
git diff-tree --no-commit-id --name-only -r "$parent" ${{ github.sha }} | tee "$OUTFILE" | |
fi | |
- name: Run validation | |
run: | | |
if [ ${{ github.event_name }} == "schedule" ]; then | |
echo "Validating all projects (schedule)" | |
python validate.py -v | |
else | |
export FILELIST=$HOME/filelist.txt | |
cat "$FILELIST" | |
if grep -q '^validate.py' "$FILELIST"; then | |
echo "Validating all projects (script changed)" | |
python validate.py -v | |
else | |
projects=$(cat "$FILELIST" | grep '^annotated-projects' | cut -d/ -f 2) | |
echo "Validating projects:" $projects | |
python validate.py -v $projects | |
fi | |
fi | |
# mage_tab_validation: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Setup conda | |
# uses: s-weigand/setup-conda@v1 | |
# with: | |
# update-conda: true | |
# conda-channels: anaconda, bioconda, conda-forge | |
# - name: Install perl-atlas-modules | |
# run: conda create -n perl-atlas -c ebi-gene-expression-group -c bioconda perl-atlas-modules perl-graphviz | |
# - name: Validate General MAGE-TAB | |
# run: | | |
# . /usr/share/miniconda/bin/activate /usr/share/miniconda/envs/perl-atlas | |
# perl simple_validate_magetab.pl | |
# - name: Archive production artifacts | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: sdrf-picture | |
# path: graph_file_sdrf.png | |
# retention-days: 5 | |
# mage_tab_expression_atlas_validations: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Setup conda | |
# uses: s-weigand/setup-conda@v1 | |
# with: | |
# update-conda: true | |
# conda-channels: anaconda, bioconda, conda-forge | |
# - name: Install perl-atlas-modules | |
# run: conda create -n perl-atlas -c ebi-gene-expression-group perl-atlas-modules | |
# - name: Validate Expression Atlas MAGE-TAB | |
# id: atlas | |
# run: | | |
# . /usr/share/miniconda/bin/activate /usr/share/miniconda/envs/perl-atlas | |
# perl validate_magetab.pl -i annotated-projects/PXD000288/PXD000288.idf.tsv -x -c -v | |
# RSPEC_RESULT=$? | |
# exit 0 | |