mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
85 lines
2.2 KiB
YAML
85 lines
2.2 KiB
YAML
---
|
|
name: CI
|
|
'on': push
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.9.13'
|
|
|
|
- name: Install Poetry Action
|
|
uses: snok/install-poetry@v1.3.1
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-2
|
|
|
|
- run: poetry install
|
|
- name: Test
|
|
run: poetry run pytest --cov --cov-fail-under=73
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
CMD_BUILD: |
|
|
brew install create-dmg
|
|
poetry run make bundle_mac version=$GITHUB_REF_NAME
|
|
- os: ubuntu-latest
|
|
CMD_BUILD: |
|
|
poetry run make bundle_linux version=$GITHUB_REF_NAME
|
|
- os: windows-latest
|
|
CMD_BUILD: |
|
|
poetry run make bundle_windows version=$env:GITHUB_REF_NAME
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.9.13'
|
|
|
|
- name: Install Poetry Action
|
|
uses: snok/install-poetry@v1.3.1
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-2
|
|
|
|
- run: poetry install
|
|
- run: ${{ matrix.CMD_BUILD }}
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Buzz
|
|
path: |
|
|
dist/buzz*.dmg
|
|
dist/buzz*.tar.gz
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: [build, test]
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: Buzz
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
buzz*.tar.gz
|
|
buzz*.dmg
|