-
Notifications
You must be signed in to change notification settings - Fork 20
71 lines (67 loc) · 2 KB
/
ci.yml
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
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "v*"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
with:
args: 'format --check'
test-integration:
name: Test Integration
runs-on: ubuntu-latest
# run integration tests on PRs originating in the upstream repo (non-forks only)
if: github.repository == 'axiomhq/axiom-py' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
needs: lint
strategy:
fail-fast: true
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Test against development
run: uv run pytest
env:
AXIOM_URL: ${{ secrets.TESTING_DEV_API_URL }}
AXIOM_TOKEN: ${{ secrets.TESTING_DEV_TOKEN }}
AXIOM_ORG_ID: ${{ secrets.TESTING_DEV_ORG_ID }}
- name: Test against staging
run: uv run pytest
env:
AXIOM_URL: ${{ secrets.TESTING_STAGING_API_URL }}
AXIOM_TOKEN: ${{ secrets.TESTING_STAGING_TOKEN }}
AXIOM_ORG_ID: ${{ secrets.TESTING_STAGING_ORG_ID }}
publish:
name: Publish on PyPi
runs-on: ubuntu-latest
if: github.repository == 'axiomhq/axiom-py' && startsWith(github.ref, 'refs/tags')
needs:
- test-integration
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- run: uv build
- run: uvx twine upload dist/*
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}"