Skip to content

Commit

Permalink
made reusable ci action
Browse files Browse the repository at this point in the history
  • Loading branch information
jtisbell4 committed Apr 18, 2024
1 parent 3c7f188 commit 39e49c4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 27 deletions.
56 changes: 56 additions & 0 deletions .github/actions/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
workflow_dispatch:
workflow_call:

jobs:
lint-and-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Execute tox envs
working-directory: ./python
run: tox lint
- name: Execute tox envs
working-directory: ./python
run: tox type-check

test:
needs: ci
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Execute tox envs
working-directory: ./python
run: tox
- name: Publish test coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ./python/coverage.xml
30 changes: 3 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,10 @@ name: Test
on:
pull_request:
branches: [ 'master' ]
# workflow_dispatch:
push:
branches: ['*']


jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Execute tox envs
working-directory: ./python
run: tox
- name: Publish test coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ./python/coverage.xml
ci:
uses: ./.github/actions/ci.yml

0 comments on commit 39e49c4

Please sign in to comment.