Skip to content

Commit

Permalink
Add CI workflow (#2)
Browse files Browse the repository at this point in the history
* Add CI workflow
* Publish to testpypi on demand #testpypi
  • Loading branch information
dlobato authored Mar 5, 2024
1 parent 8db16ff commit ad2720b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U pip pipx
pipx install poetry==1.7.1
poetry config virtualenvs.in-project true
poetry install
- name: Flake8
run: make flake8
- name: Mypy
run: make mypy
- name: Pylint
run: make pylint
- name: Build single-dc-l3ls-fabric
run: poetry run pyavd-build -i tests/data/single-dc-l3ls-fabric/inventory.yml -o intended-single-dc-l3ls-fabric -f FABRIC -v
- name: Store single-dc-l3ls-fabric intended configs
uses: actions/upload-artifact@v4
with:
name: single-dc-l3ls-fabric configs
path: intended-single-dc-l3ls-fabric/
9 changes: 5 additions & 4 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -42,7 +42,7 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -63,7 +63,7 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: "contains(github.event.head_commit.message, '#testpypi')"
needs:
- build
runs-on: ubuntu-latest
Expand All @@ -107,7 +108,7 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down

0 comments on commit ad2720b

Please sign in to comment.