Skip to content

Commit

Permalink
Fix build-system of pyproject.toml. The build job as part of CI w…
Browse files Browse the repository at this point in the history
…orkflow (#130)
  • Loading branch information
edxu96 authored May 28, 2023
1 parent 785ae38 commit 0c12e05
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 49 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/build.yml

This file was deleted.

45 changes: 42 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- '.python-version'
- 'poetry.toml'
pull_request:
types: [ opened, reopened ]
branches: [ master ]
paths-ignore:
- 'README.md'
Expand All @@ -22,14 +21,22 @@ on:
- 'poetry.toml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
name: pip install, check pre-commit and run pytest
runs-on: macos-latest
name: pre-commit and test
runs-on: ${{ matrix.os }}

strategy:
matrix:
python-version: [3.7.1, 3.6.7]
# Need to fix the version of Ubuntu and macos, because Python
# 3.6 is unavailable in x64 macos or arch x64 Ubuntu.
# https://github.blog/2023-03-01-github-actions-introducing-faster-github-hosted-x64-macos-runners/.
os: [ubuntu-20.04, windows-latest, macos-11]

steps:
- uses: actions/checkout@master
Expand All @@ -38,6 +45,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
Expand All @@ -51,3 +59,34 @@ jobs:

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

build:
name: build wheels
runs-on: ${{ matrix.os }}
needs: test
if: github.ref == 'refs/heads/master'

strategy:
matrix:
# Need to fix the version of Ubuntu and macos, because Python
# 3.6 is unavailable in x64 macos or arch x64 Ubuntu.
# https://github.blog/2023-03-01-github-actions-introducing-faster-github-hosted-x64-macos-runners/.
os: [ubuntu-20.04, windows-latest, macos-11]

steps:
- uses: actions/checkout@master

- name: Install dependecies, which will not be built again
uses: actions/setup-python@v2
with:
python-version: 3.7.1
cache: 'pip'

- name: Build wheels
run: |
pip wheel -w ./dist/ .
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: ./dist/cmdict-*.whl
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exclude = '''
'''

[build-system]
requires = ["poetry>=0.12"]
requires = ["poetry>=1.2.0a1"]
build-backend = "poetry.masonry.api"

[tool.pytest.ini_options]
Expand Down

0 comments on commit 0c12e05

Please sign in to comment.