forked from openproblems-bio/openproblems
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (106 loc) · 3.87 KB
/
process_results.yml
File metadata and controls
121 lines (106 loc) · 3.87 KB
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
name: Process Nextflow results
on:
repository_dispatch:
types: [benchmark_complete]
push:
branches:
- 'test_process'
jobs:
process_results:
runs-on: ubuntu-latest
env:
UPDATE_BRANCH_NAME: "auto_update_benchmark_${{ github.run_number }}"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: openproblems
- name: Checkout website repo
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: openproblems-bio/website
path: website
token: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
- name: Set up Git branch
working-directory: website
run: |
git checkout -b $UPDATE_BRANCH_NAME
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python }}
- name: Install AWS CLI
run: |
mkdir /tmp/awscli
cd /tmp/awscli
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install || sudo ./aws/install --update
aws --version
- name: Install package & dependencies
run: |
python -m pip install --upgrade pip
pip install -U wheel setuptools
pip install -U --editable ./openproblems[process]
python -c "import openproblems"
- name: Parse results
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
run: |
if [[ ${{ github.event_name }} == "repository_dispatch" ]]; then
S3_URI="s3://openproblems-nextflow/cwd_main"
else
S3_URI="s3://openproblems-nextflow/cwd_example"
fi
aws s3 cp --quiet --recursive "${S3_URI}" /tmp/results/
rm -r website/data/results/*/
rm -r website/content/benchmarks/*/
python openproblems/workflow/parse_nextflow.py /tmp website/data/results
python openproblems/workflow/generate_website_markdown.py website/content/benchmarks
- name: AWS S3 cleanup
if: "github.event_name == 'repository_dispatch'"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
run: |
aws s3 rm --recursive "s3://openproblems-nextflow/work_main"
aws s3 rm --recursive "s3://openproblems-nextflow/cwd_example"
aws s3 cp --recursive "s3://openproblems-nextflow/cwd_main" "s3://openproblems-nextflow/cwd_example"
aws s3 rm --recursive "s3://openproblems-nextflow/cwd_main"
- name: Push to openproblems-bio/website
if: "github.event_name == 'repository_dispatch'"
shell: bash
working-directory: './website'
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
run: |
git push origin "${UPDATE_BRANCH_NAME}"
- name: Create Pull Request
if: "github.event_name == 'repository_dispatch'"
uses: peter-evans/create-pull-request@v4
with:
branch: ${{ env.UPDATE_BRANCH_NAME }}
delete-branch: true
base: main
title: '[auto] Update benchmark results'
reviewers: scottgigante, dburkhardt
path: './website'
token: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
author: "openproblems-bio <singlecellopenproblems@protonmail.com>"
commit-message: "Update benchmark results # ci skip"
- name: Upload results on test
if: "github.event_name != 'repository_dispatch'"
uses: actions/upload-artifact@main
with:
name: results
path: website/data/results
- name: Upload markdown on test
if: "github.event_name != 'repository_dispatch'"
uses: actions/upload-artifact@main
with:
name: markdown
path: website/content/benchmarks