GitHub Actions and reusable workflows used by IIASA repositories.
Set up Anaconda or Miniconda.
- README
- For a usage example, see the "conda" workflow of iiasa/message_ix.
Set up GAMS.
- README
- For a usage example, see the "pytest" workflow of iiasa/ixmp.
See GitHub's documentation pages on “Reusing workflows”. The usage examples are from the workflows of the same name in iiasa/ixmp
Important: This workflow is no longer used in most IIASA ECE program repositories. Instead, an ordinary job is used to invoke pre-commit via uvx. See iiasa/message_ix/.github/workflows.pytest.yaml for an example. Pre-commit in turn allows to configure a repo-specific set of checks and check arguments, whereas this reusable action used a fixed set.
Lint and check Python code with black, flake8, isort, and mypy.
Usage example:
name: Lint on: # Run the workflow on pushes to `main`, or new commits on PRs into `main` push: branches: [ main ] pull_request: branches: [ main ] jobs: lint: uses: iiasa/actions/.github/workflows/lint.yaml@main with: max-complexity: 15 python-version: "3.10" type-hint-packages: pytest genno GitPython xarray sphinx types-setuptools
Build Python package distributions, check with twine
, and publish to (Test)PyPI.
Usage example:
name: Build package and publish on: pull_request: branches: [ main ] # Package is built and checked push: branches: [ main ] # Package is built and checked tags: [ "v*" ] # Package is published to PyPI release: types: [ published ] # Package is also published to PyPI jobs: publish: uses: iiasa/actions/.github/workflows/publish.yaml@main secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} # Publish to TestPyPI; omit with: to publish to PyPI itself with: repository-url: https://test.pypi.org/legacy/