-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 1.8 KB
/
update_tsvs_now.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
name: Update recommendations now
on:
workflow_dispatch:
jobs:
recompute-recommendations:
runs-on: ubuntu-20.04
steps:
# step 1: checkout the repository
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true # checkout submodules as well
# step 2: setup Python environment
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
# step 3: install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
# step 4: run recommendation systems
- name: Run keyword-based recommendation system
run: python run_kwd_recs.py
- name: Run BM25 recommendation system
run: python run_bm25_recs.py
- name: Run SPECTER recommendation system
run: python run_spctr_recs.py
# step 5: run the unit tests
- name: Run unit tests
run: |
set +e # Continue execution even if the tests fail
python tests.py > tests.log 2>&1
cat tests.log
continue-on-error: true
# step 6: commit and push changes if there are any
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
git add dhq-recs*.tsv
git commit -m "feat: update recommendations due to request on ${TIMESTAMP}"
git pull --rebase
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main