Skip to content

Commit

Permalink
update ci.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
soundsonacid committed Jul 12, 2024
1 parent 2728416 commit e911d50
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 44 deletions.
87 changes: 44 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,47 +50,48 @@ jobs:
run: poetry run bash scripts/ci.sh

bump-version:
runs-on: ubicloud
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10.10'
- name: Run version bump script
run: python scripts/bump.py
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add pyproject.toml src/driftpy/__init__.py .bumpversion.cfg
git commit -m "Bump version [skip ci]"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
runs-on: ubicloud
needs: [black, tests]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10.10'
- name: Run version bump script
run: python scripts/bump.py
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add pyproject.toml src/driftpy/__init__.py .bumpversion.cfg
git commit -m "Bump version [skip ci]"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

# release:
# runs-on: ubicloud
# needs: [black, tests, bump-version]
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10.10'
# - name: Install and configure Poetry
# uses: snok/[email protected]
# with:
# version: 1.4.2
# virtualenvs-create: true
# virtualenvs-in-project: true
# installer-parallel: true
# - run: poetry build
# - run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
release:
runs-on: ubicloud
needs: [bump-version]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10.10'
- name: Install and configure Poetry
uses: snok/[email protected]
with:
version: 1.4.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
14 changes: 13 additions & 1 deletion scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#!/bin/bash
set -e

echo "Running tests:"
pytest -v -s -x tests/ci/*.py
pytest -v -s tests/math/*.py
pytest -v -s tests/math/*.py

exit_code=$?

if [ $exit_code -ne 0 ]; then
echo "Tests failed with exit code $exit_code"
exit $exit_code
fi

echo "All tests passed successfully"

0 comments on commit e911d50

Please sign in to comment.