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

translate .travis.yml’s script part for GH Actions #78

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
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
43 changes: 43 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Draft release

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install CI dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install

- name: Test & lint
run: make -f Makefile.ci

- name: Create git tag
run: |
TAG=v$(poetry run transformer --version)
git tag --force $TAG
git push --tags

- name: Build package
run: poetry build

- name: Prepare draft GitHub Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
dist/har-transformer-*.tar.gz
dist/har_transformer-*.whl
fail_on_unmatched_files: true
68 changes: 68 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Check

on:
pull_request:
branches: [master]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
include:
# https://python-poetry.org/docs/configuration#cache-dir
- os: ubuntu-latest
pip-cache-path: ~/.cache/pip
poetry-cache-path: ~/.cache/pypoetry
- os: windows-latest
pip-cache-path: '%LOCALAPPDATA%\pip\Cache'
poetry-cache-path: '%LOCALAPPDATA%\pypoetry\Cache'
- os: macOS-latest
pip-cache-path: ~/Library/Caches/pip
poetry-cache-path: ~/Library/Caches/pypoetry
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Set up cache
uses: actions/cache@v2
with:
path: |
${{ matrix.pip-cache-path }}
${{ matrix.poetry-cache-path }}
key: ${{ runner.os }}-python-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-poetry-

- name: Install CI dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install

- name: Execute Makefile.ci
run: make -f Makefile.ci

- name: Check the package builds correctly
run: make clean && poetry build

- name: Export sdist as artifact
uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/har-transformer-*.tar.gz
29 changes: 29 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PyPI upload

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'

# From https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
- name: Install pypa/build
run: python -m pip install build --user

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .

- name: pypi-publish
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

Loading