Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
344 changes: 184 additions & 160 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,113 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
session:
- black
- docformatter
- isort
- mypy
- pylint
- unimport
# lint:
# runs-on: ubuntu-latest

# strategy:
# fail-fast: false
# matrix:
# session:
# - black
# - docformatter
# - isort
# - mypy
# - pylint
# - unimport

# steps:
# - name: Check out repository
# uses: actions/checkout@v3

# - name: Setup python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.DEFAULT_PYTHON }}
# cache: pip

# # FIXME: we should take dwas from pypi once it's published
# - name: Install dwas
# run: python -m pip install .

# - name: ${{ matrix.session }}
# run: dwas --verbose --only ${{ matrix.session }}

# package:
# runs-on: ubuntu-latest
# steps:
# - name: Check out repository
# uses: actions/checkout@v3

# - name: Setup python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.DEFAULT_PYTHON }}
# cache: pip

# # FIXME: we should take dwas from pypi once it's published
# - name: Install dwas
# run: python -m pip install .

# - name: package
# run: dwas --verbose --only package

# - name: Save packaged dist
# uses: actions/upload-artifact@v3
# with:
# name: dist
# path: ${{ env.PACKAGES_PATH }}/*
# retention-days: 7

# test:
# runs-on: ${{ matrix.os }}
# needs: package

# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# python:
# - "3.8"
# - "3.9"
# - "3.10"
# - "3.11"
# - "pypy3.8"
# include:
# - os: windows-latest
# python: "3.8"

# steps:
# - name: Check out repository
# uses: actions/checkout@v3

# - name: Setup python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}
# cache: pip

# # FIXME: we should take dwas from pypi once it's published
# - name: Install dwas
# run: python -m pip install .

# - name: Download packaged dist
# uses: actions/download-artifact@v3
# with:
# name: dist
# path: ${{ env.PACKAGES_PATH }}

# - name: pytest[${{ matrix.python }}]
# run: dwas --verbose --only pytest[${{ matrix.python }}] -- --numprocesses auto

# - name: Save coverage files
# uses: actions/upload-artifact@v3
# with:
# name: coverage-files-pytest-${{ matrix.python }}
# path: ${{ env.COVERAGE_FILES_PATH }}
# retention-days: 7

windows:
runs-on: windows-latest

steps:
- name: Check out repository
Expand All @@ -42,154 +136,84 @@ jobs:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: "3.11"
cache: pip

# FIXME: we should take dwas from pypi once it's published
- name: Install dwas
run: python -m pip install .

- name: ${{ matrix.session }}
run: dwas --verbose --only ${{ matrix.session }}

package:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: pip

# FIXME: we should take dwas from pypi once it's published
- name: Install dwas
run: python -m pip install .

- name: package
run: dwas --verbose --only package

- name: Save packaged dist
uses: actions/upload-artifact@v3
with:
name: dist
path: ${{ env.PACKAGES_PATH }}/*
retention-days: 7

test:
runs-on: ubuntu-latest
needs: package

strategy:
fail-fast: false
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "pypy3.8"

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip

# FIXME: we should take dwas from pypi once it's published
- name: Install dwas
run: python -m pip install .

- name: Download packaged dist
uses: actions/download-artifact@v3
with:
name: dist
path: ${{ env.PACKAGES_PATH }}

- name: pytest[${{ matrix.python }}]
run: dwas --verbose --only pytest[${{ matrix.python }}] -- --numprocesses auto

- name: Save coverage files
uses: actions/upload-artifact@v3
with:
name: coverage-files-pytest-${{ matrix.python }}
path: ${{ env.COVERAGE_FILES_PATH }}
retention-days: 7

coverage:
runs-on: ubuntu-latest
needs: test

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: pip

# FIXME: we should take dwas from pypi once it's published
- name: Install dwas
run: python -m pip install .

# This will download add artifacts that were generated before, which is not ideal
# as we only need some of them, but it's simpler than having to repeat them one by one
- name: Download generated coverage files
uses: actions/download-artifact@v3
with:
path: _cache

- name: Move artifacts to the right place
run: mkdir -p .dwas/cache && mv _cache/*/pytest-* .dwas/cache && rm -rf _cache && ls -lR .dwas/cache

- name: Generate coverage report
run: dwas --verbose --only coverage

- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
files: ./_artifacts/coverage/coverage.xml
fail_ci_if_error: true
verbose: true

- name: Save coverage report
uses: actions/upload-artifact@v3
with:
name: coverage [html]
path: _artifacts/coverage/html
retention-days: 7

twine:
runs-on: ubuntu-latest
needs: package

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: pip

- name: Download packaged dist
uses: actions/download-artifact@v3
with:
name: dist
path: ${{ env.PACKAGES_PATH }}

# FIXME: we should take dwas from pypi once it's published
- name: Install dwas
run: python -m pip install .

- name: Validate packages with twine
run: dwas --verbose --only twine:check
run: python -m pip install .[test]

- name: pytest
run: dwas pylint

# coverage:
# runs-on: ubuntu-latest
# needs: test

# steps:
# - name: Check out repository
# uses: actions/checkout@v3

# - name: Setup python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.DEFAULT_PYTHON }}
# cache: pip

# # FIXME: we should take dwas from pypi once it's published
# - name: Install dwas
# run: python -m pip install .

# # This will download add artifacts that were generated before, which is not ideal
# # as we only need some of them, but it's simpler than having to repeat them one by one
# - name: Download generated coverage files
# uses: actions/download-artifact@v3
# with:
# path: _cache

# - name: Move artifacts to the right place
# run: mkdir -p .dwas/cache && mv _cache/*/pytest-* .dwas/cache && rm -rf _cache && ls -lR .dwas/cache

# - name: Generate coverage report
# run: dwas --verbose --only coverage

# - name: Upload coverage to codecov
# uses: codecov/codecov-action@v3
# with:
# files: ./_artifacts/coverage/coverage.xml
# fail_ci_if_error: true
# verbose: true

# - name: Save coverage report
# uses: actions/upload-artifact@v3
# with:
# name: coverage [html]
# path: _artifacts/coverage/html
# retention-days: 7

# twine:
# runs-on: ubuntu-latest
# needs: package

# steps:
# - name: Check out repository
# uses: actions/checkout@v3

# - name: Setup python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.DEFAULT_PYTHON }}
# cache: pip

# - name: Download packaged dist
# uses: actions/download-artifact@v3
# with:
# name: dist
# path: ${{ env.PACKAGES_PATH }}

# # FIXME: we should take dwas from pypi once it's published
# - name: Install dwas
# run: python -m pip install .

# - name: Validate packages with twine
# run: dwas --verbose --only twine:check
Loading