Skip to content

Commit

Permalink
Merge pull request #30 from simonsobs/dev
Browse files Browse the repository at this point in the history
Update GitHub Actions workflows
  • Loading branch information
TaiSakuma authored Feb 8, 2024
2 parents 95e318d + 989cf8a commit 0952ad7
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 72 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@ on:
push:
tags:
- 'v*.*.*'

jobs:
deploy:

runs-on: ubuntu-latest

environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install packages
run: |
pip install --upgrade pip
pip install --upgrade hatch
- name: Build
run: hatch build

- name: pypi-publish
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Install packages
run: |
pip install --upgrade pip
pip install --use-pep517 -e '.[dev,tests]'
pip install -e '.[tests]'
pip install --upgrade mypy
- name: Run mypy
run: mypy nextlinegraphql/ tests/
run: mypy --show-traceback nextlinegraphql/ tests/
59 changes: 35 additions & 24 deletions .github/workflows/unit-test-dev.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,51 @@
name: Run unit tests with Nextline dev

# Test with nextline checked out from GitHub (rather than from PyPI)
# coverage won't be run
# coverage won't be run

on:
push:
branches:
- '**'
- "**"
pull_request:
branches:
- '**'
- "**"

jobs:
build:
concurrency:
group: unit-test-dev-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
run:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pwd
cd ..
git clone https://github.com/simonsobs/nextline.git
python -m pip install -e './nextline'
cd -
python -m pip install -e '.[tests]'
python -m pip list
- name: Test with pytest
run: |
pytest -vv
- uses: actions/checkout@v3

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

- name: Install packages
run: |
python -m pip install --upgrade pip
pwd
cd ..
git clone https://github.com/simonsobs/nextline.git
pip install -e './nextline'
cd -
pip install -e '.[tests]'
pip list
- name: Run tests
run: |
pytest -vv
60 changes: 35 additions & 25 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
name: Run unit tests

# nextline will installed from PyPI

on:
push:
branches:
- '**'
- "**"
pull_request:
branches:
- '**'
- "**"

jobs:
build:
concurrency:
group: unit-test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
run:
name: Python ${{ matrix.python-version }} on Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[tests]'
python -m pip list
- name: Test with pytest
run: |
pytest -vv --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true
- uses: actions/checkout@v3

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

- name: Install packages
run: |
pip install --upgrade pip
pip install -e '.[tests]'
pip list
- name: Run tests
run: pytest -vv --cov --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true

0 comments on commit 0952ad7

Please sign in to comment.