Merge pull request #232 from FAIRDataPipeline/update-lxml #584
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 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/ | |