Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-slac committed Oct 5, 2022
1 parent fe65268 commit 919e737
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 43 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@ on:

jobs:
build_and_test:
# runs-on: ubuntu-latest
# Need >= 20.04 for modern sqlite. Can switch to latest when
# github change
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Need to clone everything for the git tags.
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: strict
show-channel-urls: true

- name: Update pip/wheel infrastructure
shell: bash -l {0}
run: |
conda install -y -q pip wheel
conda install -y -q "pip<22" wheel
- name: Install dependencies
shell: bash -l {0}
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: check Python formatting
name: Check Python formatting

on:
push:
Expand All @@ -7,21 +7,5 @@ on:
pull_request:

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

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install isort and black
run: pip install isort black

- name: Run isort
run: isort --diff --check-only python/ tests/

- name: Run black
run: black --check --verbose --diff python/ tests/
call-workflow:
uses: lsst/rubin_workflows/.github/workflows/formatting.yaml@main
23 changes: 6 additions & 17 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
name: lint

on:
- push
- pull_request
push:
branches:
- main
pull_request:

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

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install
run: pip install -r <(curl https://raw.githubusercontent.com/lsst/linting/main/requirements.txt)

- name: Run linter
run: flake8
call-workflow:
uses: lsst/rubin_workflows/.github/workflows/lint.yaml@main
42 changes: 42 additions & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run mypy

on:
push:
branches:
- main
pull_request:

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10.6"
cache: "pip"

- name: Install
run: pip install mypy pydantic

- name: Install types dependencies
run: |
if [ -e types.txt ]
then
pip install -r types.txt
fi
- name: Install lsst dependencies
run: |
if [ -e requirements.txt ]
then
pip install -r requirements.txt
fi
- name: Run mypy
run: |
prefix="python/lsst"
echo "__all__ = ['__version__']" > "${prefix}/daf/butler_migrate/version.py"
echo "__version__ = '0.0.1'" >> "${prefix}/daf/butler_migrate/version.py"
mypy "${prefix}"

0 comments on commit 919e737

Please sign in to comment.