Skip to content

Commit

Permalink
ci: cleanup workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Apr 5, 2022
1 parent e9fda3b commit f4b50f3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 52 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/code-quality.yaml

This file was deleted.

50 changes: 25 additions & 25 deletions .github/workflows/tests.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,33 @@ name: Tests
on:
pull_request: {}
push:
branches: [main]
branches:
- main


concurrency:
group: tests-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: "${{ matrix.os }}-latest"
continue-on-error: ${{ matrix.experimental }}
name: ${{ matrix.os }} / ${{ matrix.python-version }} ${{ matrix.suffix }}
runs-on: ${{ matrix.image }}
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [3.6, 3.7, 3.8, 3.9]
experimental: [false]
bootstrap-args: [""]
os: [Ubuntu, macOS, Windows]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- os: Ubuntu
python-version: pypy3
experimental: false
- os: Ubuntu
python-version: "3.10.0-alpha - 3.10.0"
experimental: true
bootstrap-args: "--git https://github.com/python-poetry/poetry.git"
image: ubuntu-latest
- os: Windows
image: windows-2022
- os: macOS
image: macos-11
fail-fast: false
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2

Expand All @@ -35,26 +40,21 @@ jobs:

- name: Get full Python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

- name: Bootstrap poetry
shell: bash
run: |
curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \
| python - -y ${{ matrix.bootstrap-args }}
curl -sL https://install.python-poetry.org | python - -y ${{ matrix.bootstrap-args }}
- name: Update PATH
if: ${{ matrix.os != 'Windows' }}
shell: bash
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Update Path for Windows
if: ${{ matrix.os == 'Windows' }}
shell: bash
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH

- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true

- name: Set up cache
Expand All @@ -66,13 +66,13 @@ jobs:

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: timeout 10s poetry run pip --version || rm -rf .venv

- name: Install dependencies
shell: bash
run: poetry install

- name: Install pytest plugin
run: poetry run pip install pytest-github-actions-annotate-failures

- name: Run pytest
shell: bash
run: poetry run python -m pytest -q tests/
run: poetry run python -m pytest -p no:sugar -q tests/
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,22 @@ on:
- '*.*.*'

jobs:
Release:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get tag
id: tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install Poetry
run: |
curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \
| python - -y
curl -sL https://install.python-poetry.org | python - -y ${{ matrix.bootstrap-args }}
- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

Expand All @@ -37,6 +33,7 @@ jobs:
run: |
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
|| echo ::set-output name=prerelease::true
- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand Down

0 comments on commit f4b50f3

Please sign in to comment.