Skip to content

Commit

Permalink
Merge pull request #24 from onnela-lab/maintenance
Browse files Browse the repository at this point in the history
Maintenance for continuous integration.
  • Loading branch information
tillahoffmann authored Nov 15, 2024
2 parents 67f4048 + 794f9eb commit ade7ebc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: gptools

on:
push:
Expand All @@ -7,6 +7,10 @@ on:
branches: ["main"]
workflow_dispatch:

# Needed for pypi using trusted publisher setup.
permissions:
id-token: write

env:
# Our tests may contain a number of stochastic elements. Setting a seed will make sure they are
# not flaky (but also hide potential issues).
Expand All @@ -23,11 +27,11 @@ jobs:
name: Package tests and linting
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
${{ env.pythonLocation }}
Expand All @@ -51,14 +55,12 @@ jobs:
- name: Upload the package to test pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages_dir: ${{ matrix.module }}/dist
repository_url: https://test.pypi.org/legacy/
skip_existing: true
packages-dir: ${{ matrix.module }}/dist
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Upload the package to pypi on `main` only
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'onnela-lab'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'onnela-lab' && matrix.python-version == '3.10'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: ${{ matrix.module }}/dist
skip_existing: true
packages-dir: ${{ matrix.module }}/dist
skip-existing: true
2 changes: 1 addition & 1 deletion stan/tests/test_stan_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def assert_stan_function_allclose(
return
# Verify against expected value. We only check one because we have already verified that they
# are the same.
result, = fit.stan_variable("result")
result = fit.stan_variable("result")[0]
if not isinstance(desired, list):
desired = [desired]
try:
Expand Down

0 comments on commit ade7ebc

Please sign in to comment.