test pool #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 1,15 * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry and coveralls | |
run: >- | |
python -m pip install --upgrade poetry coveralls | |
- name: Install dependencies (with all extras) | |
run: | | |
poetry install --all-extras | |
- name: Generate .ztfquery | |
env: | |
ZTFQUERY_KEY: ${{ secrets.ztfquery_key }} | |
ZTFDATA: ./ | |
run: | | |
python tests/generate_ztfquery_keystore.py | |
- name: Test the code | |
env: | |
ZTFDATA: ./ | |
run: | | |
poetry run coverage run -m pytest -v | |
# # Push the coverage result to coveralls.io | |
# - name: Run Coveralls | |
# env: | |
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
# if: ${{ success() }} | |
# run: coveralls | |
- name: Echo tag name | |
run: echo "Tag is ${{ github.ref }}, Tagged is ${{ startsWith(github.ref, 'refs/tags/')}}, Python Check is ${{matrix.python-version == 3.11}}, Deploy is ${{ startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.11}}" | |
# Build a tarball and push to Pypi if tagged with new version | |
- name: Build and publish | |
if: ${{ startsWith(github.ref, 'refs/tags/') && success() && matrix.python-version == 3.11}} | |
run: | | |
poetry publish -n --build | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} | |
# dependabot: | |
# needs: [build] | |
# runs-on: ubuntu-latest | |
# if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} | |
# steps: | |
# - name: Enable auto-merge for Dependabot PRs | |
# run: gh pr merge --auto --merge "$PR_URL" | |
# env: | |
# PR_URL: ${{github.event.pull_request.html_url}} | |
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |