-
Notifications
You must be signed in to change notification settings - Fork 18
79 lines (62 loc) · 2.19 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 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}}