barcode update #656
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: barcode update | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/**' | |
jobs: | |
testsuite: | |
runs-on: macos-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@main | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup for conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-version: "latest" | |
auto-update-conda: true | |
channels: bioconda,conda-forge | |
channel-priority: true | |
python-version: '3.10' | |
activate-environment: test | |
- name: Install | |
shell: bash -l {0} | |
run: | | |
conda install -n base conda-libmamba-solver | |
conda config --set solver libmamba | |
conda config --add channels bioconda | |
conda config --add channels conda-forge | |
conda install --yes --file ci/conda_requirements.txt | |
pip install -e . --no-deps | |
- name: update | |
shell: bash -l {0} | |
env: | |
TREELINK: ${{ secrets.TREELINK }} | |
ZIPNAME: ${{ secrets.ZIPNAME }} | |
run: | | |
conda activate test | |
wget "${TREELINK}" | |
freyja barcode-build --pb "${ZIPNAME}" --outdir freyja/data/ | |
- name: commit if output is different | |
run: | | |
echo "running git diff, committing if different" | |
if [[($(git status freyja/data/usher_barcodes.feather --porcelain | wc -c) -ne 0)]]; then | |
echo "changes were made, updating barcodes" | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "[email protected]" | |
echo $(date +"%m_%d_%Y-%H-%M")> freyja/data/last_barcode_update.txt | |
git add freyja/data/last_barcode_update.txt | |
git add freyja/data/lineages.yml | |
git add freyja/data/usher_barcodes.feather | |
git add freyja/data/lineage_mutations.json | |
git add freyja/data/curated_lineages.json | |
git commit -m "updating barcodes and metadata" | |
git push origin main | |
else | |
echo "no changes were made, doing nothing." | |
fi; | |