Skip to content

Commit

Permalink
Refactor workflows (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
durandtibo authored Sep 15, 2023
1 parent 36eb579 commit 24908d3
Show file tree
Hide file tree
Showing 8 changed files with 575 additions and 951 deletions.
524 changes: 10 additions & 514 deletions .github/workflows/ci.yaml

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Code Coverage
on:
workflow_call:
workflow_dispatch: # to trigger manually

jobs:
coverage:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
max-parallel: 8
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install packages
run: |
poetry run make config-poetry
poetry run make install-all
- name: Show installed packages
run: |
poetry run poetry show
poetry run poetry show --tree
- name: Run unit tests
run: |
poetry run make unit-test-cov
- name: Upload coverage to Codecov
if: github.repository == 'durandtibo/coola' && (github.event_name == 'push' || github.event_name == 'pull_request')
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
# Ignore codecov failures as the codecov server is not
# very reliable but we don't want to report a failure
# in the github UI just because the coverage report failed to
# be published.
fail_ci_if_error: false

- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: ./coverage.xml:coverage.py
debug: true
56 changes: 56 additions & 0 deletions .github/workflows/cyclic-imports.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Cyclic Imports
on:
workflow_call:
workflow_dispatch: # to trigger manually

jobs:
cyclic-import:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
max-parallel: 8
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install packages
run: |
poetry run make config-poetry
poetry run make install-all
- name: Show installed packages
run: |
poetry run poetry show
poetry run poetry show --tree
- name: check coola.comparators
run: |
poetry run python -c "from coola import comparators"
- name: check coola.formatters
run: |
poetry run python -c "from coola import formatters"
- name: check coola.reducers
run: |
poetry run python -c "from coola import reducers"
- name: check coola.summarizers
run: |
poetry run python -c "from coola import summarizers"
- name: check coola.testers
run: |
poetry run python -c "from coola import testers"
- name: check coola.utils
run: |
poetry run python -c "from coola import utils"
41 changes: 41 additions & 0 deletions .github/workflows/doctest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Documentation Tests
on:
workflow_call:
workflow_dispatch: # to trigger manually

jobs:
doctest:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
max-parallel: 8
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install packages
run: |
poetry run make config-poetry
poetry run make install-all
- name: Show installed packages
run: |
poetry run poetry show
poetry run poetry show --tree
- name: Run doctest on source code
run: |
poetry run make doctest-src
45 changes: 45 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Format
on:
workflow_call:
workflow_dispatch: # to trigger manually

jobs:
format:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
max-parallel: 8
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install packages
run: |
poetry run make config-poetry
poetry run make install-all
- name: Show installed packages
run: |
poetry run poetry show
poetry run poetry show --tree
- name: Format
run: |
poetry run make format
- name: Lint
run: |
poetry run make lint
Loading

0 comments on commit 24908d3

Please sign in to comment.