Skip to content

Commit

Permalink
add other actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Jul 17, 2024
1 parent 4e9a138 commit 569e8d4
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build and test
on:
push:
paths:
- '**.yml'
- '**.toml'
- '**.ini'
- '**.py'
- '**.json'
- '**.csv'
- '**.pkl'
- '**.pbz2'
pull_request:
paths:
- '**.yml'
- '**.toml'
- '**.ini'
- '**.py'
- '**.json'
- '**.csv'
- '**.pkl'
- '**.pbz2'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
auto-update-conda: true
activate-environment: cge_env
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Build
shell: bash -l {0}
run: |
pip install -e .
- name: Test
shell: bash -l {0}
working-directory: ./
run: |
python -m pytest
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && contains(github.repository, 'PSLmodels/CGE')
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
34 changes: 34 additions & 0 deletions .github/workflows/check_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check that docs build
on:
pull_request:
paths:
- './docs/*'
- '**.md'
- './open_cge/**.py'

jobs:
build-and-deploy:
if: github.repository == 'PSLmodels/CGE'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: cge_env
environment-file: environment.yml
python-version: 3.7
auto-activate-base: false

- name: Install and Build # install Sphinx and build docs
shell: bash -l {0}
run: |
conda install sphinx
conda list
pip install -e .
cd docs
make html
14 changes: 14 additions & 0 deletions .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Check Black formatting

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
options: "-l 79 --check"
src: "."

0 comments on commit 569e8d4

Please sign in to comment.