-
Notifications
You must be signed in to change notification settings - Fork 18
53 lines (45 loc) · 1.98 KB
/
nightly.yaml
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
name: Nightly workflow tests
on:
# Uncomment these two lines for debugging, but leave them commented on 'main'
# pull_request:
# branches: [ main ]
push:
branches: [ main ]
schedule:
# 05:00 UTC = 06:00 CET = 07:00 CEST
- cron: "0 5 * * *"
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dev dependencies
run: |
pip install --upgrade pip wheel
pip install -e .[tests]
- name: Download MAGICC
run: |
mkdir -p bin/magicc/magicc-v7.5.3
wget -O "bin/magicc/magicc-v7.5.3.tar.gz" "${{ secrets.MAGICC_LINK_FROM_MAGICC_DOT_ORG }}"
tar -xf bin/magicc/magicc-v7.5.3.tar.gz -C bin/magicc/magicc-v7.5.3
MAGICC_RUN_DIR=bin/magicc/magicc-v7.5.3/run/ python scripts/generate-magicc-sr15-input-files.py
mkdir -p data/magicc-drawnsets
wget -O "data/magicc-drawnsets/magicc-ar6-0fd0f62-f023edb-drawnset.tar.gz" "${{ secrets.MAGICC_PROB_DISTRIBUTION_LINK_FROM_MAGICC_DOT_ORG }}"
tar -xf "data/magicc-drawnsets/magicc-ar6-0fd0f62-f023edb-drawnset.tar.gz" -C data/magicc-drawnsets
- name: Test with pytest
env:
MAGICC_EXECUTABLE_7: /home/runner/work/climate-assessment/climate-assessment/bin/magicc/magicc-v7.5.3/bin/magicc
MAGICC_WORKER_NUMBER: 4
MAGICC_WORKER_ROOT_DIR: /tmp
run: |
MAGICC_PROBABILISTIC_FILE=data/magicc-drawnsets/0fd0f62-derived-metrics-id-f023edb-drawnset.json pytest tests -m nightly -r a -vv
- name: Test run with .env only
run: |
echo "MAGICC_EXECUTABLE_7=${PWD}/bin/magicc/magicc-v7.5.3/bin/magicc" > .env
echo "MAGICC_WORKER_NUMBER=4" >> .env
echo "MAGICC_WORKER_ROOT_DIR=/tmp" >> .env
MAGICC_PROBABILISTIC_FILE=data/magicc-drawnsets/0fd0f62-derived-metrics-id-f023edb-drawnset.json pytest tests/nightly/test_workflow_nightly.py -m nightly -r a -vv