forked from datalad/datalad-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-{{extension.name}}.yaml
84 lines (78 loc) · 2.8 KB
/
test-{{extension.name}}.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
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
# This file is autogenerated from extensions.yaml using scripts/generate.
# See CONTRIBUTING.md for more information
name: test-{{ extension.name }}
on:
# Trigger the workflow on pull request,
# but only if any given extension workflow was modified
pull_request:
paths:
- '.github/workflows/test-{{ extension.name }}.yaml'
# all should be triggered on cron
schedule:
- cron: '30 01 * * *'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# name mimics the one in .travis.yml for datalad build introduced in
# https://github.com/datalad/datalad/pull/4640
annex-install-scenario: [neurodebian, datalad-extensions-latest]
fail-fast: false
steps:
- uses: actions/checkout@v1
- name: Set up system
shell: bash
run: |
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
sudo apt-get update -qq
sudo apt-get install eatmydata
case "${{ matrix.annex-install-scenario }}" in
neurodebian)
sudo eatmydata apt-get install git-annex-standalone
;;
datalad-extensions-latest)
sudo eatmydata apt-get install jq
GITHUB_TOKEN=${{ secrets.datalad_github_token }} ./scripts/ci/download-latest-artifact
sudo eatmydata dpkg -i download/*.deb
;;
*)
echo "Unknown scenario ${{ matrix.annex-install-scenario }}" >&2
exit 1
esac
- name: Set up environment
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Almighty"
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install DataLad (master)
run: |
python -m pip install --upgrade pip
pip install https://github.com/datalad/datalad/archive/master.zip
- name: Install {{ extension.name }} extension from PyPI ([devel])
run: |
pip install {{ extension.pypi }}[devel]
- name: Install nose et al (just in case!)
# Note, that we need nose even in case of pytest, due to test helpers
# depending on it.
run: |
pip install nose vcrpy mock
{%- if extension.apt_depends %}
- name: Install APT depends for the extension
run: sudo eatmydata apt-get install {{ extension.apt_depends | join(' ')}}
{% endif %}
- name: WTF!?
run: |
datalad wtf
- name: {{ extension.name }} tests
run: |
mkdir -p __testhome__
cd __testhome__
{% if extension.tester == 'nose' %}
python -m nose -s -v --with-cov --cover-package datalad {{ extension.package }}
{% elif extension.tester == 'pytest' %}
python -m pytest -s -v --cov=datalad --cov={{ extension.package }} --pyargs {{ extension.package }}
{% endif %}