fix: Fixit4 (#148) #596
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
Delete-libraries: | |
runs-on: ubuntu-latest | |
steps: | |
- name: delete | |
run: | | |
df -h | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
Cancel-previous-jobs: | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/main' | |
steps: | |
- uses: khan/[email protected] | |
with: | |
workflows: "main.yml" | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
Formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Formatting | |
uses: github/super-linter@v4 | |
env: | |
VALIDATE_ALL_CODEBASE: false | |
DEFAULT_BRANCH: main | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FILTER_REGEX_EXCLUDE: CHANGELOG.md | |
VALIDATE_SNAKEMAKE_SNAKEFMT: true | |
VALIDATE_PYTHON_BLACK: true | |
VALIDATE_MARKDOWN: true | |
Linting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Lint workflow | |
uses: snakemake/snakemake-github-action@v1 | |
with: | |
directory: . | |
snakefile: workflow/Snakefile | |
args: "--lint" | |
Testing: | |
runs-on: ubuntu-latest | |
needs: | |
- Linting | |
- Formatting | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check for cache | |
id: check-cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.tests/resources/* | |
.tests/data/2022-03-17/* | |
key: ${{ runner.os }}-data-cache-${{ hashFiles('.tests/resources/*') }}-${{ hashFiles('.tests/data/2022-03-17/*') }} | |
#restore-keys: | | |
# ${{ runner.os }}-data-cache | |
# ${{ runner.os }}- | |
#env: | |
# CACHE_HIT: ${{ steps.check-cache.outputs.cache-hit }} | |
#run: | | |
# cache_hit = ${{ steps.check-cache.outputs.cache-hit }} | |
# echo $cache_hit | |
# echo "CACHE_HIT=$cache_hit" >> $GITHUB_ENV | |
#- name: Check cache input | |
# id: cache-check | |
# run: | | |
# ls -la .tests/resources/ | |
- name: Download test dataset | |
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }} | |
run: | | |
cd .tests/resources | |
ls -la | |
wget -O ref-seqs.qza https://data.qiime2.org/2022.2/common/silva-138-99-seqs.qza | |
wget -O ref-taxa.qza https://data.qiime2.org/2022.2/common/silva-138-99-tax.qza | |
wget --no-check-certificate -O ref-genome.fna.gz https://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/annotation/GRCh38_latest/refseq_identifiers/GRCh38_latest_genomic.fna.gz | |
gzip -d ref-genome.fna.gz | |
mkdir filtering-database/ | |
tar -xf small_db.tgz --directory filtering-database/ | |
rm small_db.tgz | |
cd filtering-database | |
mv small_db/* . | |
rm -r small_db | |
cd ../.. | |
mkdir -p data/2022-03-17 | |
curl -sL \ | |
https://data.qiime2.org/2022.2/tutorials/importing/casava-18-paired-end-demultiplexed.zip > \ | |
data/2022-03-17/casava-18-paired-end-demultiplexed.zip | |
cd data/2022-03-17 | |
unzip -q casava-18-paired-end-demultiplexed.zip | |
rm casava-18-paired-end-demultiplexed.zip | |
mv casava-18-paired-end-demultiplexed/* . | |
rm -r casava-18-paired-end-demultiplexed/ | |
rm blank* | |
rm PAP* | |
rm YUN* | |
rm Rep* | |
rm BAQ2* | |
rm BAQ3* | |
rm BAQ1* | |
rm BAQ4166.2* | |
rm BAQ4166.3* | |
cd ../../ | |
ls -la | |
df -h | |
- name: Cache test_data | |
id: cache-test-data | |
uses: actions/cache@v2 | |
#if: ${{ steps.check-cache.outputs.cache-hit != 'true' }} | |
with: | |
path: | | |
.tests/resources/* | |
.tests/data/2022-03-17/* | |
key: ${{ runner.os }}-data-cache-${{ hashFiles('.tests/resources/*') }}-${{ hashFiles('.tests/data/2022-03-17/*') }} | |
restore-keys: | | |
${{ runner.os }}-data-cache | |
${{ runner.os }}- | |
- name: Check cache input | |
id: cache-check-two | |
run: | | |
ls -la .tests/resources/ | |
ls -la .tests/data/2022-03-17/ | |
#- name: Restore data from cache | |
# id: restore-cache | |
# uses: actions/cache@v3 | |
# if: ${{ steps.check-cache.outputs.cache-hit == 'true' }} | |
# with: | |
# path: | | |
# .tests/resources/* | |
# .tests/data/2022-03-17/* | |
# key: ${{ runner.os }}-data-cache-${{ hashFiles('.tests/resources/*') }}-${{ hashFiles('.tests/data/2022-03-17/*') }} | |
# restore-keys: | | |
# ${{ runner.os }}-data-cache-${{ hashFiles('.tests/resources/*') }}-${{ hashFiles('.tests/data/2022-03-17/*') }} | |
# ${{ runner.os }}-my-cache- | |
# ${{ runner.os }}- | |
- name: Test workflow (local test data) | |
uses: snakemake/snakemake-github-action@v1 | |
with: | |
directory: .tests | |
snakefile: workflow/Snakefile | |
args: "--use-conda --show-failed-logs -j 2 --conda-cleanup-pkgs cache --dry-run" | |
#- name: Get test variable | |
# id: value_generator | |
# run: | | |
# cd .tests/results/2022-03-17/out | |
# abundancevalue=$(<abundance.txt) | |
# testvalue=0 | |
# echo $abundancevalue | |
# echo $testvalue | |
# echo "ABUNDANCE_VALUE=$abundancevalue" >> $GITHUB_ENV | |
# echo "TESTVALUE=$testvalue" >> $GITHUB_ENV | |
#- name: Test variable value | |
# if: ${{ env.ABUNDANCE_VALUE <= env.TESTVALUE }} | |
# #run: | | |
# echo ${{ env.ABUNDANCE_VALUE }} | |
# echo ${{ env.TESTVALUE }} | |
# uses: actions/github-script@v3 | |
# with: | |
# script: | | |
# core.setFailed("No abundance filtered!") | |
#- name: Test report | |
# uses: snakemake/snakemake-github-action@v1 | |
# with: | |
# directory: .tests | |
# snakefile: workflow/Snakefile | |
# args: "--report report.zip" |