-
Notifications
You must be signed in to change notification settings - Fork 30
67 lines (58 loc) · 2.09 KB
/
update_barcodes.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
name: barcode update
on:
schedule:
- cron: '0 0 * * *'
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:
auto-update-conda: true
channels: bioconda,conda-forge
channel-priority: true
python-version: 3.7
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.csv --porcelain | wc -c) -ne 0)]]; then
echo "changes were made, updating barcodes"
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
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.csv
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;