mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
chore: update ci workflows
this adds a proper release workflow (that I already know) and a test workflow that installs and uses pytest
This commit is contained in:
parent
72d8ab526f
commit
8499c81f7d
3 changed files with 56 additions and 50 deletions
50
.github/workflows/release.yaml
vendored
50
.github/workflows/release.yaml
vendored
|
|
@ -1,50 +0,0 @@
|
||||||
name: Continuous Delivery
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- chore/ci-setup
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
concurrency: release
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# Note: we need to checkout the repository at the workflow sha in case during the workflow
|
|
||||||
# the branch was updated. To keep PSR working with the configured release branches,
|
|
||||||
# we force a checkout of the desired release branch but at the workflow sha HEAD.
|
|
||||||
- name: Setup | Checkout Repository at workflow sha
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Setup | Force correct release branch on workflow sha
|
|
||||||
run: |
|
|
||||||
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Action | Semantic Version Release
|
|
||||||
id: release
|
|
||||||
# Adjust tag with desired version if applicable.
|
|
||||||
uses: python-semantic-release/python-semantic-release@v9.16.1
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
git_committer_name: "github-actions"
|
|
||||||
git_committer_email: "actions@users.noreply.github.com"
|
|
||||||
|
|
||||||
# - name: Publish | Upload package to PyPI
|
|
||||||
# uses: pypa/gh-action-pypi-publish@v1
|
|
||||||
# if: steps.release.outputs.released == 'true'
|
|
||||||
|
|
||||||
- name: Publish | Upload to GitHub Release Assets
|
|
||||||
uses: python-semantic-release/publish-action@v9.16.1
|
|
||||||
if: steps.release.outputs.released == 'true'
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
tag: ${{ steps.release.outputs.tag }}
|
|
||||||
24
.github/workflows/release.yml
vendored
Normal file
24
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
name: release-please
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-please:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: googleapis/release-please-action@v4
|
||||||
|
with:
|
||||||
|
# this assumes that you have created a personal access token
|
||||||
|
# (PAT) and configured it as a GitHub action secret named
|
||||||
|
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
|
||||||
|
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
||||||
|
# this is a built-in strategy in release-please, see "Action Inputs"
|
||||||
|
# for more options
|
||||||
|
release-type: python
|
||||||
32
.github/workflows/tests.yml
vendored
Normal file
32
.github/workflows/tests.yml
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
name: Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
pip install -e .
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
pytest
|
||||||
Loading…
Add table
Add a link
Reference in a new issue