Skip to content

Commit

Permalink
Add Github Actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
wookayin committed Aug 30, 2023
1 parent 11e9323 commit 18beef4
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Run Tests"
on: [push, pull_request, workflow_dispatch]

defaults:
run:
shell: bash

jobs:
unit-tests:
name: "Unit Tests"
runs-on: ${{ matrix.os }}
timeout-minutes: 10

strategy:
matrix:
include:
- os: ubuntu-20.04
python-version: "3.6"
- os: ubuntu-latest
python-version: "3.7"
- os: ubuntu-latest
python-version: "3.8"
- os: ubuntu-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"

steps:
- uses: actions/checkout@v2

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

- name: Upgrade pip
run: |
python -m pip install -U pip
- name: Configure environments
run: |
python --version
- name: Install dependencies
run: |
pip install -e ".[test]"
python -m imgcat --version
- name: Run tests
run: |
pytest --color=yes -v -s
env:
PYTHONIOENCODING: UTF-8
45 changes: 45 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish to PyPI
on:
push:
tags:
- '*'

jobs:
build-and-release:
name: Build and make a release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

- name: Upgrade pip
run: |
python -m pip install -U pip
- name: Configure environments
run: |
python --version
- name: Install dependencies
run: |
pip install -e ".[test]"
- name: Run tests
run: |
pytest --color=yes -v -s
env:
PYTHONIOENCODING: UTF-8

- name: Build a source distribution
run: >-
GPUSTAT_VERSION=${{ steps.tag.outputs.TAG_NAME }} python setup.py sdist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 18beef4

Please sign in to comment.