Skip to content

Commit

Permalink
Added workflow improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Jan 3, 2022
1 parent c7fc5e6 commit 9ea9cbe
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 45 deletions.
8 changes: 8 additions & 0 deletions .github/actions/dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Install dependencies
description: Install base and test dependencies
runs:
using: "composite"
steps:
- run: pip install -r requirements.txt -r test_requirements.txt
shell: bash
21 changes: 21 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Lint
description: Check style for every file
runs:
using: "composite"
steps:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
uses: ./.github/actions/dependencies

- name: Run pre-commit
run: pre-commit run --all-files
shell: bash

- name: Lint
run: python -m pylint -j 0 -f parseable neptune tests
shell: bash
54 changes: 25 additions & 29 deletions .github/workflows/neptune-client.yml → .github/workflows/full.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,48 @@
name: neptune-client
on: [push]
name: Test
on:
push:
branches:
- master
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.6, 3.7, 3.8 ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Install test dependencies
run: |
pip install -r test_requirements.txt
- name: Run pre-commit
run: |
pre-commit run --all-files
- name: Checkout repository
uses: actions/checkout@v2

- name: Lint
run: |
python -m pylint -j 0 -f parseable neptune tests
uses: ./.github/actions/lint

test:
integration:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
include:
- os: ubuntu-latest
python-version: 3.9
- os: macos-latest
python-version: 3.9
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Install test dependencies
run: |
pip install -r test_requirements.txt
uses: ./.github/actions/dependencies

- name: Build and test
run : |
tox -e py
publish:
needs: [lint, test]
needs: [lint, integration]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test
on:
push:
branches-ignore:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Lint
uses: ./.github/actions/lint

integration:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.9] # minimum, maximum
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
uses: ./.github/actions/dependencies

- name: Build and test
run : |
tox -e py
30 changes: 14 additions & 16 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
freezegun==1.1.0
mock==2.0.0
munch==2.3.2
psutil==5.6.6
pylint==1.9.5; python_version < '3.0'
pylint==2.9.6; python_version >= '3.0'
pylintfileheader==0.0.2
pytest>=5.0
pytest-cov==2.10.1
pytest-xdist==2.2.0
tensorflow; python_version >= '3.0'
tox==3.6.1
pytest-timeout==1.4.2
freezegun
mock
munch
pylint==2.9.6
pylintfileheader
pytest
pytest-cov
pytest-xdist
tensorflow; python_version <= '3.9'
tox
pytest-timeout
matplotlib==3.2
pytest-mock==3.3.1
moto[s3]==2.2.1
pytest-mock
moto[s3]
plotly
altair
vega_datasets
bokeh
pre-commit

# Installing Torch on Windows increases the test duration by ~10 minutes
torch; platform_system != 'Windows' and python_version >= '3.6'
torch; platform_system != 'Windows' and python_version <= '3.9'

0 comments on commit 9ea9cbe

Please sign in to comment.