Skip to content

Commit

Permalink
new workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
emptymalei committed Oct 28, 2023
1 parent ba193ce commit 33f8d2a
Show file tree
Hide file tree
Showing 7 changed files with 1,473 additions and 39 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/docs-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,32 @@ on:
branches:
- master
- main
workflow_dispatch:
inputs:
whotriggered:
description: 'Manually Build Docs'
default: 'Just want to build it'
required: false

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
python-version: 3.x
- run: pip install mkdocs
- run: pip install mkdocs-material
- run: pip install mkdocs-material-extensions
- run: pip install mkdocs-autorefs
- run: pip install mkdocstrings
- run: pip install -e ".[all]"
- run: mkdocs gh-deploy --force
poetry-version: 1.3.2
- name: Install Packages
run: poetry install
- run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Deploy
run: poetry run mkdocs gh-deploy --force
9 changes: 6 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Build and Publish Package to Pypi

on:
push:
branches:
- "main"
workflow_dispatch:
inputs:
name:
description: 'release it'
required: false
default: 'I Just wanna release it'

jobs:
tests:
Expand Down
76 changes: 50 additions & 26 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Code with Pip
name: Test Code

on:
push:
Expand All @@ -15,40 +15,64 @@ on:
required: false
default: 'I Just wanna test it'

permissions:
contents: read
issues: read
checks: write
pull-requests: write

jobs:
build:
test:
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: [3.9.16, 3.10.8]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install from source (required for the pre-commit tests)
run: pip install ".[all]"
- name: Install dependencies
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Install
run: poetry install
- name: Build coverage file
run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# install black if available (Python 3.6 and above), and autopep8 for testing the pipe mode
pip install black || true
pip install autopep8 || true
- name: Lint with flake8
poetry run pytest --cache-clear --junitxml=test_results/${{ matrix.os }}/pytest_report_${{ matrix.python-version }}.xml tests/
- name: Check files
run: |
pip install flake8==3.8.3
pip install flake8-black==0.2.1
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# all Python files should follow PEP8
# echo "flake8 all python"
# flake8 durst tests
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
echo "flake8 BLK"
flake8 durst --count --exit-zero --max-complexity=18 --statistics --select BLK
- name: Test with pytest
run: nosetests
ls -l test_results/
ls -l test_results/${{ matrix.os }}/
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: test_results/${{ matrix.os }}/pytest_report_${{ matrix.python-version }}.xml
# - name: Comment coverage
# uses: coroo/[email protected]

publish-test-results:
name: "Publish Tests Results"
needs: test
runs-on: ubuntu-latest
# the build-and-test job might be skipped, we don't need to run this job then
if: success() || failure()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Check files
run: |
ls -l artifacts/
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: "artifacts/**/*.xml"
Empty file.
Empty file added haferml/transformations/base.py
Empty file.
Loading

0 comments on commit 33f8d2a

Please sign in to comment.