fix: update beet #678
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
PYTHON_VERSION: "3.10" | |
POETRY_VERSION: "1.4.2" | |
jobs: | |
main: | |
name: Test and release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Cache poetry | |
id: cache-poetry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local | |
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }} | |
- name: Install poetry | |
if: steps.cache-poetry.outputs.cache-hit != 'true' | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-in-project: true | |
- name: Cache venv | |
id: cache-venv | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}- | |
- name: Install dependencies | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
run: poetry install | |
- name: Setup npm cache | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
- name: Install Pyright | |
if: steps.cache-npm.outputs.cache-hit != 'true' | |
run: npm install | |
- name: Run tests | |
run: poetry run pytest -v | |
- name: Run type-checking | |
run: npm run check | |
- name: Check formatting | |
run: poetry run black --check mecha tests | |
- name: Release | |
if: | | |
github.repository == 'mcbeet/mecha' | |
&& github.event_name == 'push' | |
&& github.ref == 'refs/heads/main' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
poetry run semantic-release publish -v DEBUG -D commit_author="github-actions <[email protected]>" |