Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #10

Merged
merged 5 commits into from
Jun 24, 2024
Merged

test #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 12 additions & 43 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,13 @@
name: Bump version

on:
pull_request:
types:
- closed

jobs:
test:
if: github.event.pull_request.merged == true
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
include:
- name: 'check'
python: '3.11'
os: 'ubuntu-latest'
- name: 'py311 (ubuntu)'
python: '3.11'
python_arch: 'x64'
os: 'ubuntu-latest'
- name: 'py311 (windows)'
python: '3.11'
python_arch: 'x64'
os: 'windows-latest'
- name: 'py39 (macos)'
python: '3.11'
python_arch: 'arm64'
os: 'macos-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Poetry
run: pipx install poetry || pip install poetry
- name: Install dependencies
run: poetry install --with dev
- name: Run tests
run: poetry run pytest

bump_version_and_publish:
needs: test
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -56,14 +17,22 @@ jobs:
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Set up Python ${{ matrix.python }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
run: pipx install poetry || pip install poetry
- name: Install dependencies
run: poetry install --with dev
run: |
poetry lock --no-update
poetry install --with dev
- name: Verify tests
run: |
if ! gh run list --branch "${{ github.ref }}" --event push --workflow test.yml --json conclusion -q '[0].conclusion' | grep -q "success"; then
echo "Tests did not pass. Aborting."
exit 1
fi
- name: Bump version and push tag
if: success() # Only continue if all was successful till now
uses: anothrNick/github-tag-action@1.67.0
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/test_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test
on:
push:

jobs:
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
include:
# - name: 'check'
# python: '3.11'
# os: 'ubuntu-latest'
- name: 'py311 (ubuntu)'
python: '3.11'
python_arch: 'x64'
os: 'ubuntu-latest'
# - name: 'py311 (windows)'
# python: '3.11'
# python_arch: 'x64'
# os: 'windows-latest'
# - name: 'py311 (macos)'
# python: '3.11'
# python_arch: 'arm64'
# os: 'macos-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Poetry
run: pipx install poetry || pip install poetry
- name: Install dependencies
run: |
poetry lock --no-update
poetry install --with dev
- name: Run tests
run: poetry run pytest
Loading