-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (61 loc) · 1.99 KB
/
test_rainforest_dev.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: Test rainforest dev
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
unit_tests:
name: Unit Tests (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: ["3.9","3.10","3.11"]
max-parallel: 6
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
ref: dev
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install rainforest
if: matrix.os != 'macos-latest'
working-directory: ${{github.workspace}}
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install -r test_requirements.txt
pip install .
- name: Create rainforest_data folder
run: |
mkdir -p ${{github.workspace}}/rainforest_data
- name: Check imports
env:
AWS_KEY: ${{ secrets.AWS_KEY }}
RAINFOREST_DATAPATH: ${{github.workspace}}/rainforest_data
working-directory: /tmp/
run: |
python -c "import rainforest; print(rainforest.__file__)"
- name: Run tests
env:
AWS_KEY: ${{ secrets.AWS_KEY }}
RAINFOREST_DATAPATH: ${{github.workspace}}/rainforest_data
working-directory: ${{github.workspace}}
run: pytest tests_ci
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}