-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (105 loc) · 4.05 KB
/
fair-data-registry.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: FAIR Data Registry
on: [push, workflow_dispatch]
jobs:
test:
name: Test ${{ matrix.os }} with Python ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python: ['3.8','3.9','3.x']
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- name: setup-python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install graphviz on ubuntu
run: |
if [ ${{ runner.os }} == "Linux" ]; then
sudo apt-get install graphviz
else
brew install graphviz
fi
- name: Run Tests
run: |
python -m pip install -r local-requirements.txt
DJANGO_SETTINGS_MODULE=drams.test-settings coverage run --omit=drams,scripts,tools manage.py test
- name: Generate XML
run: coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
files: ./coverage.xml
flags: unittests
verbose: true
deploy-local-registry:
name: Deploy local registry on ${{ matrix.os }} with Python ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python: ['3.8','3.9','3.x']
env:
REGISTRY_PORT: 8001
INSTALL_DIR: fair
steps:
- name: setup-python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Deploy registry
if: startsWith(github.ref, 'refs/tags/') != true
run: curl -fsSL https://raw.githubusercontent.com/FAIRDataPipeline/data-registry/${GITHUB_REF/refs\/heads\//}/static/localregistry.sh | bash -s -- -d $INSTALL_DIR -b ${GITHUB_REF/refs\/heads\//}
- name: Deploy registry (Tagged Release)
if: startsWith(github.ref, 'refs/tags/')
run: curl -fsSL https://raw.githubusercontent.com/FAIRDataPipeline/data-registry/${GITHUB_REF/refs\/tags\//}/static/localregistry.sh | bash -s -- -d $INSTALL_DIR -t ${GITHUB_REF/refs\/tags\//}
- name: Start registry
run: |
$INSTALL_DIR/registry/scripts/start_fair_registry -p $REGISTRY_PORT
- name: Test registry
run: curl http://localhost:$REGISTRY_PORT/api/
deploy-local-registry-windows:
name: Deploy Local Registry on Windows
runs-on: windows-latest
env:
REGISTRY_PORT: 8001
INSTALL_DIR: fair
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install CURL
run: |
choco install curl
choco install wget
- name: Branch name
id: branch_name
run: |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
shell: bash
- name: Deploy registry
if: startsWith(github.ref, 'refs/tags/') != true
shell: cmd
run: |
wget https://raw.githubusercontent.com/FAIRDataPipeline/data-registry/%SOURCE_BRANCH%/static/localregistry.bat
localregistry.bat -d %INSTALL_DIR% -b %SOURCE_BRANCH%
env:
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
- name: Deploy registry (Tagged Release)
if: startsWith(github.ref, 'refs/tags/')
shell: cmd
run: |
wget https://raw.githubusercontent.com/FAIRDataPipeline/data-registry/%SOURCE_TAG%/static/localregistry.bat
localregistry.bat -d %INSTALL_DIR% -t %SOURCE_TAG%
env:
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
- name: Start registry and test
shell: cmd
run: |
start /wait /b %INSTALL_DIR%\scripts\start_fair_registry_windows.bat -p %REGISTRY_PORT% -a 127.0.0.1 -b
curl http://127.0.0.1:%REGISTRY_PORT%/api/