Skip to content

push

push #1890

Workflow file for this run

name: 'push'
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 5'
env:
# https://github.com/tox-dev/tox/issues/1468
PY_COLORS: 1
jobs:
#
# Python code format
#
fmt:
runs-on: ubuntu-latest
name: '🐍 black'
steps:
- name: '🧰 Checkout'
uses: actions/checkout@v4
- name: '🐍 Setup Python'
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: '🐍 Install dependencies'
run: |
pip install -U pip --progress-bar off
pip install -U virtualenv tox --progress-bar off
- name: '🐍 Run black'
run: tox -e py313-fmt -- --diff --color
#
# Linux linting and unit tests
#
lin:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { py: '3.13' , task: 313-lint }
- { py: '3.7' , task: 37-unit }
- { py: '3.13' , task: 313-unit }
name: '🐧 Ubuntu · ${{ matrix.task }}'
steps:
- name: '🧰 Checkout'
uses: actions/checkout@v4
- name: '🐍 Setup Python'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: '🐍 Install dependencies'
run: |
pip install -U pip --progress-bar off
pip install -U virtualenv tox --progress-bar off
- name: '🚧 Run job'
run: tox -e py${{ matrix.task }} -- --color=yes
#
# Docker (Linux) tests (GHDL)
#
ghdl:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task: [
{do: 313-acceptance, tag: llvm},
{do: 313-vcomponents, tag: mcode},
]
name: '🛳️ Container · ${{ matrix.task.do }} · ${{ matrix.task.tag }}'
steps:
- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: '🚧 Run job'
run: docker run --rm -tv $(pwd):/src -w /src ghcr.io/vunit/dev/${{ matrix.task.tag }} tox -e py${{ matrix.task.do }}-ghdl
#
# Docker (Linux) tests (NVC)
#
nvc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task: [
{do: 39-acceptance},
{do: 39-vcomponents},
]
name: '🛳️ Container · ${{ matrix.task.do }} · NVC'
steps:
- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: '🚧 Run job'
uses: docker://ghcr.io/vunit/dev/nvc@sha256:e6337a2b40a2eed076ffda9a5ef0af2c676718fcc7cf0c31fcfe24505de759c4
with:
args: tox -e py${{ matrix.task.do }}-nvc
#
# Windows (MSYS2) with 'nightly' GHDL
#
win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
task: [
310-acceptance-ghdl,
310-vcomponents-ghdl,
310-lint,
310-unit,
]
name: '🟦 Windows · nightly · ${{ matrix.task }}'
defaults:
run:
shell: msys2 {0}
steps:
- name: '🟦 Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-python-pip
- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: '⚙️ Setup GHDL'
uses: ghdl/setup-ghdl-ci@master
with:
backend: llvm
- name: '🐍 Install dependencies'
run: pip install -U tox --progress-bar off
- name: '🚧 Run job'
run: tox -e py${{ matrix.task }} -- --color=yes
#
# Deploy to PyPI
#
deploy:
runs-on: ubuntu-latest
needs:
- fmt
- lin
- ghdl
- nvc
- win
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
name: '🚀 Deploy'
steps:
- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: '🐍 Setup Python'
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: '🐍 Install dependencies'
run: |
pip install -U pip
pip install -U setuptools wheel twine
- name: '🚀 Build and deploy to PyPI'
if: github.repository == 'VUnit/vunit'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.VUNIT_HDL_PYPI_DEPLOY_TOKEN }}
run: |
./tools/release.py validate
python setup.py sdist
twine upload dist/*