-
Notifications
You must be signed in to change notification settings - Fork 3
163 lines (155 loc) · 5.5 KB
/
main.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: CI
on:
push:
branches:
- builder_branch_JJ
jobs:
build-hcmi:
runs-on: ubuntu-20.04
environment: build
steps:
- name: Checkout HCMI
uses: actions/checkout@v2
- name: Build HCMI Image
run: docker build -t hcmi-builder -f build/docker/Dockerfile.hcmi .
- name: Run HCMI Container
run: docker run --name hcmi-container hcmi-builder
- name: Copy files from HCMI Container
run: |
mkdir hcmi-files
for file in hcmi_samples.csv hcmi_transcriptomics.csv hcmi_copy_number.csv hcmi_mutations.csv; do
docker cp hcmi-container:/usr/src/app/$file hcmi-files/$file
done
- name: Get HCMI container logs
run: docker logs hcmi-container
# - name: dummy hcmi
# run: |
# mkdir hcmi-files
# echo "This is some sample text." > hcmi-files/d.txt
# echo "Another line of text." > hcmi-files/c.gz
- name: Upload artifacts for HCMI
uses: actions/upload-artifact@v2
with:
name: hcmi-files
path: hcmi-files
build-beataml:
runs-on: ubuntu-20.04
environment: build
steps:
- name: Checkout code BeatAML
uses: actions/checkout@v2
- name: Build BeatAML Image
run: docker build -t beataml-builder -f build/docker/Dockerfile.beataml .
- name: Run BeatAML Container
run: docker run --name beataml-container -e SYNAPSE_TOKEN=${{ secrets.SYNAPSE_TOKEN_SECRET }} beataml-builder
- name: Copy files from BeatAML Container
run: |
mkdir beataml-files
for file in beataml_samples.csv beataml_transcriptomics.csv beataml_proteomics.csv beataml_mutations.csv beataml_drugs.tsv beataml_experiments.csv; do
docker cp beataml-container:/usr/src/app/$file beataml-files/$file
done
- name: Get BeatAML container logs
run: docker logs beataml-container
- name: Upload artifact for BeatAML
uses: actions/upload-artifact@v2
with:
name: beataml-files
path: beataml-files
data-visualization:
environment: build
runs-on: ubuntu-20.04
if: always()
steps:
- name: checkout repo content
uses: actions/checkout@v2
- name: Download artifacts from HCMI
uses: actions/download-artifact@v2
with:
name: hcmi-files
- name: Download artifacts from BeatAML
uses: actions/download-artifact@v2
with:
name: beataml-files
- name: Create all-files directory
run: mkdir all-files
- name: List files cwd
run: ls -lah
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Run Visualization02
if: success() || failure()
run: Rscript visualization02.r
- name: Run Visualization01
if: success() || failure()
run: Rscript visualization01.r
- name: setup data-vis dir
if: success() || failure()
run: |
mkdir data-vis
mv *.png data-vis
mv *.pdf data-vis
mv *table.csv data-vis
- name: Upload artifacts
if: success() || failure()
uses: actions/upload-artifact@v2
with:
name: data-vis
path: data-vis
data-visualization-save-to-docs:
environment: build
runs-on: ubuntu-20.04
if: always()
steps:
- name: Checkout repo content
uses: actions/checkout@v2
- name: Download artifacts from data-vis
uses: actions/download-artifact@v2
with:
name: data-vis
- name: Move files to docs directory
run: |
mv data-vis/* docs/
- name: Setup Git config
run: |
git config user.name "jjacobson95"
git config user.email "[email protected]"
- name: Commit and push changes
run: |
git add .
git commit -m "Add data visualization artifacts to docs"
if git diff --staged --quiet; then
echo "No changes to commit."
else
git push
fi
upload-to-figshare:
needs: [build-hcmi, build-beataml]
environment: build
runs-on: ubuntu-20.04
if: always()
steps:
- name: checkout repo content
uses: actions/checkout@v2
- name: Download artifacts from HCMI
uses: actions/download-artifact@v2
with:
name: hcmi-files
- name: Download artifacts from BeatAML
uses: actions/download-artifact@v2
with:
name: beataml-files
- name: Create all-files directory
run: mkdir all-files
- name: List files cwd
run: ls -lah
- name: Move files to all-files
run: |
rsync -av --remove-source-files --include='*.csv' --include='*.tsv' --include='*.gz' --exclude='*' . all-files/
- name: List files in all-files
run: ls -lah all-files/
- name: Upload to Figshare
# This can be updated to trigger with tag releases.
# run: python scripts/push_to_figshare.py --directory all-files --title "CODERData${{ github.event.release.tag_name }}" --token ${{ secrets.FIGSHARE_TOKEN_SECRET }} -p False
#This is a short term alternative. Links to branch. Not as pretty but okay for now.
#To do: Extract version number from setup.py and run there. This can occur after merge with package dev branch.
run: python scripts/push_to_figshare.py --directory all-files --title "CODERData${{ github.ref }}" --token ${{ secrets.FIGSHARE_TOKEN_SECRET }} -p False