Skip to content

Commit

Permalink
Merge pull request #133 from NOWUM/dependabot-update
Browse files Browse the repository at this point in the history
activates dependabot, updates dependencies
  • Loading branch information
jsejdija authored Jul 17, 2023
2 parents caab3be + e34750d commit 6a1253c
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 136 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
# See https://flake8.pycqa.org/en/latest/user/configuration.html
max-line-length = 150
max-complexity = 10
per-file-ignores = __init__.py:F401
File renamed without changes.
105 changes: 53 additions & 52 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main

jobs:
# Inspect the information that is accessible in each context
# https://docs.github.com/en/actions/learn-github-actions/contexts#example-printing-context-information-to-the-log-file
Expand Down Expand Up @@ -36,55 +36,54 @@ jobs:
env:
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
run: echo "$MATRIX_CONTEXT"

# Check linting
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'

python-version: '3.10'

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: lint-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements**.txt') }}
key: lint-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements**.txt') }}

- name: Install requirements
run: |
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt -e .
pip install -e .[test]
- name: flake8 Lint
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ github.token }}
# Checks if all tests pass
github_token: ${{ github.token }}


# Checks if all tests pass
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
python-version: '3.10'
architecture: 'x64'

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: test-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements**.txt') }}
key: test-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements**.txt') }}

- name: Install requirements
run: |
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt -e .
Expand All @@ -94,35 +93,37 @@ jobs:
pytest --cov=./ensysmod --cov-report=xml --junitxml="result.xml" ./tests
- name: Upload tests results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: |
coverage.xml
result.xml
uplaod_coverage_results:
needs: test
needs: test
runs-on: ubuntu-latest
name: "Upload code coverage"
if: always()
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download tests results
uses: actions/download-artifact@v2
with:
name: test-results

- name: Check files
run: |
cat ./coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: pytest
fail_ci_if_error: true
Expand All @@ -138,16 +139,16 @@ jobs:
uses: actions/download-artifact@v2
with:
name: test-results

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: result.xml
report_individual_runs: true
# Test if project still runs on every os



# Test if project still runs on every os
test_build:
needs: [test, lint]
runs-on: ${{ matrix.os }}
Expand All @@ -156,33 +157,33 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
py: ["3.7", "3.8", "3.9"]
py: ["3.9", "3.10"]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
python-version: '3.10'
architecture: 'x64'

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{matrix.os}}-${{ matrix.py }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements**.txt') }}
key: ${{matrix.os}}-${{ matrix.py }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements**.txt') }}

- name: Install requirements
run: |
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt -e .
- name: Run tests
run: |
pytest ./tests
build_dev_image:
needs: [ test, lint, test_build ]
Expand All @@ -196,7 +197,7 @@ jobs:
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -226,7 +227,7 @@ jobs:
if: ${{ success() && github.actor != 'dependabot[bot]' }}
steps:
- name: Update deployment status - start
uses: bobheadxi/deployments@v0.6.2
uses: bobheadxi/deployments@v1.4.0
id: deployment
with:
step: start
Expand Down Expand Up @@ -271,11 +272,11 @@ jobs:
echo ::set-output name=ENV_URL::"${ENV_URL}"
- name: Update deployment status - finish
uses: bobheadxi/deployments@v0.6.2
uses: bobheadxi/deployments@v1.4.0
if: always()
with:
step: finish
token: ${{ github.token }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.get_env_url.outputs.env_url }}
env_url: ${{ steps.get_env_url.outputs.env_url }}
14 changes: 7 additions & 7 deletions .github/workflows/pull-request-done.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Update deployment status - deactivate
uses: bobheadxi/deployments@v0.6.2
uses: bobheadxi/deployments@v1.4.0
id: deactivate
with:
step: deactivate-env
Expand Down Expand Up @@ -116,16 +116,16 @@ jobs:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.10'
architecture: 'x64'

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: docs-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements**.txt') }}
key: docs-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements**.txt') }}

- name: Install requirements
run: |
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
if: ${{ success() && github.actor != 'dependabot[bot]' }}
steps:
- name: Update deployment status - start
uses: bobheadxi/deployments@v0.6.2
uses: bobheadxi/deployments@v1.4.0
id: deployment
with:
step: start
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
echo ::set-output name=ENV_URL::"${ENV_URL}"
- name: Update deployment status - finish
uses: bobheadxi/deployments@v0.6.2
uses: bobheadxi/deployments@v1.4.0
if: always()
with:
step: finish
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ jobs:
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.10'
architecture: 'x64'

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: lint-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements**.txt') }}
key: lint-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements**.txt') }}

- name: Install requirements
run: |
Expand All @@ -78,16 +78,16 @@ jobs:
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.10'
architecture: 'x64'

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: test-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements**.txt') }}
key: test-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements**.txt') }}

- name: Install requirements
run: |
Expand All @@ -98,7 +98,7 @@ jobs:
pytest --cov=./ensysmod --cov-report=xml --junitxml="result.xml" ./tests
- name: Upload tests results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
Expand Down Expand Up @@ -144,11 +144,11 @@ jobs:
name: test-results

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: result.xml
report_individual_runs: true
comment_mode: "create new"
comment_mode: "always"


build_pr_image:
Expand All @@ -163,7 +163,7 @@ jobs:
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
if: ${{ success() && github.actor != 'dependabot[bot]' }}
steps:
- name: Update deployment status - start
uses: bobheadxi/deployments@v0.6.2
uses: bobheadxi/deployments@v1.4.0
id: deployment
with:
step: start
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
echo ::set-output name=ENV_URL::"${ENV_URL}"
- name: Update deployment status - finish
uses: bobheadxi/deployments@v0.6.2
uses: bobheadxi/deployments@v1.4.0
if: always()
with:
step: finish
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9
FROM python:3.10

RUN apt-get update
RUN apt-get install -y glpk-utils python3-swiglpk
Expand Down
2 changes: 1 addition & 1 deletion ensysmod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
It allows someone to install %name% as package in other projects and use its functions.
"""

__version__ = "0.0.3"
__version__ = "0.0.4"
Loading

0 comments on commit 6a1253c

Please sign in to comment.