fix: populate context from config #1056
Workflow file for this run
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] | |
paths-ignore: | |
- "docs/**" | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- "docs/**" | |
env: | |
PYTHON_VERSION: "3.10" | |
POETRY_VERSION: "1.5.1" | |
jobs: | |
main: | |
name: Test and release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
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@v4 | |
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@v4 | |
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 -E image | |
- name: Setup npm cache | |
id: cache-npm | |
uses: actions/cache@v4 | |
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 beet tests | |
- name: Release | |
if: | | |
github.repository == 'mcbeet/beet' | |
&& 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 "action@github.com" | |
poetry run semantic-release publish -v DEBUG -D commit_author="github-actions <action@github.com>" |