Skip to content

Commit 472451a

Browse files
committed
restore all other workflows, release process ready to go to main with safety ON
1 parent 7be90c6 commit 472451a

6 files changed

Lines changed: 200 additions & 14 deletions

File tree

.github/workflows/_test_release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: test-release
2-
# TODO: rename this file with a leading underscore once part of the broader actual publish flow
32

43
on:
54
workflow_call:
@@ -16,8 +15,7 @@ env:
1615

1716
jobs:
1817
build:
19-
# TODO: restore handling of this flag
20-
# if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release
18+
if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release
2119
runs-on: ubuntu-latest
2220

2321
outputs:
@@ -85,5 +83,5 @@ jobs:
8583
repository-url: https://test.pypi.org/legacy/
8684
# This setting ONLY IN CI AND ON TEST PYPI! See https://github.com/pypa/gh-action-pypi-publish#tolerating-release-package-file-duplicates
8785
skip-existing: true
88-
# TODO whether to enable attestations
86+
# TODO determine whether to enable attestations later on, and how
8987
attestations: false

.github/workflows/lint.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: ruff and mypy checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
mypy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.11' # Or any version you prefer
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pipx install uv
26+
make venv
27+
28+
- name: Ruff Linting AstraPy
29+
run: |
30+
uv run ruff check astrapy
31+
32+
- name: Ruff Linting Tests
33+
run: |
34+
uv run ruff check tests
35+
36+
- name: Ruff formatting astrapy
37+
run: |
38+
uv run ruff format --check astrapy
39+
40+
- name: Ruff formatting tests
41+
run: |
42+
uv run ruff format --check tests
43+
44+
- name: Run MyPy AstraPy
45+
run: |
46+
uv run mypy astrapy
47+
48+
- name: Run MyPy Tests
49+
run: |
50+
uv run mypy tests

.github/workflows/local.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Run base integration tests on a local Data API
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
id-token: write # required for OIDC
13+
contents: read # required for actions/checkout if you use it
14+
15+
env:
16+
AWS_ECR_REGION: ${{ secrets.AWS_ECR_REGION }}
17+
AWS_ECR_ACCOUNT_ID: ${{ secrets.AWS_ECR_ACCOUNT_ID }}
18+
AWS_ECR_ROLE_NAME: ${{ secrets.AWS_ECR_ROLE_NAME }}
19+
AWS_ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPOSITORY }}
20+
AWS_ECR_REGISTRY: ${{ secrets.AWS_ECR_REGISTRY }}
21+
AWS_ECR_HCD_IMAGE_TAG: "1.2.1-early-preview"
22+
23+
jobs:
24+
test:
25+
env:
26+
HEADER_EMBEDDING_API_KEY_OPENAI: ${{ secrets.HEADER_EMBEDDING_API_KEY_OPENAI }}
27+
# hardcoding the target DB
28+
DOCKER_COMPOSE_LOCAL_DATA_API: "yes"
29+
# turn on header-based reranker auth
30+
HEADER_RERANKING_API_KEY_NVIDIA: ${{ secrets.HEADER_RERANKING_API_KEY_NVIDIA }}
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v2
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: 3.12
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pipx install uv
46+
make venv
47+
48+
- name: Configure AWS credentials from OIDC
49+
uses: aws-actions/configure-aws-credentials@v4
50+
with:
51+
role-to-assume: arn:aws:iam::${{ env.AWS_ECR_ACCOUNT_ID }}:role/${{ env.AWS_ECR_ROLE_NAME }}
52+
aws-region: ${{ env.AWS_ECR_REGION }}
53+
54+
- name: Login to Amazon ECR
55+
uses: aws-actions/amazon-ecr-login@v2
56+
57+
- name: Pull the image
58+
run: |
59+
docker pull $AWS_ECR_REGISTRY/$AWS_ECR_REPOSITORY:$AWS_ECR_HCD_IMAGE_TAG
60+
61+
- name: Run pytest
62+
run: |
63+
uv run pytest tests/base/integration

.github/workflows/main.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Run base integration tests on Astra DB
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
env:
14+
# basic secrets
15+
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
16+
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
17+
HEADER_EMBEDDING_API_KEY_OPENAI: ${{ secrets.HEADER_EMBEDDING_API_KEY_OPENAI }}
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.11
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pipx install uv
33+
make venv
34+
35+
- name: Run pytest
36+
run: |
37+
uv run pytest tests/base/integration

.github/workflows/release.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: release
22
run-name: Release by @${{ github.actor }}
33
on:
4-
# TODO: remove this trigger when done testing
5-
pull_request:
6-
branches:
7-
- main
84
workflow_dispatch:
95
inputs:
106
dangerous-nonmaster-release:
@@ -21,8 +17,7 @@ env:
2117

2218
jobs:
2319
build:
24-
# TODO: restore handling of this flag
25-
# if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release
20+
if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release
2621
runs-on: ubuntu-latest
2722

2823
outputs:
@@ -74,8 +69,7 @@ jobs:
7469
permissions: write-all
7570
with:
7671
dangerous-nonmaster-release: true
77-
# TODO: restore the below once the pull_request trigger is replaced
78-
# dangerous-nonmaster-release: ${{ inputs.dangerous-nonmaster-release }}
72+
dangerous-nonmaster-release: ${{ inputs.dangerous-nonmaster-release }}
7973
secrets: inherit
8074

8175
pre-release-checks:
@@ -207,7 +201,7 @@ jobs:
207201
repository-url: https://test.pypi.org/legacy/
208202
# This setting ONLY IN CI AND ON TEST PYPI! See https://github.com/pypa/gh-action-pypi-publish#tolerating-release-package-file-duplicates
209203
skip-existing: true
210-
# TODO whether to enable attestations
204+
# TODO determine whether to enable attestations later on, and how
211205
attestations: false
212206

213207
mark-release:
@@ -236,7 +230,7 @@ jobs:
236230
name: dist
237231
path: dist/
238232

239-
- name: Create release
233+
- name: Create release (TMP draft, prerelease)
240234
uses: ncipollo/release-action@v1
241235
with:
242236
artifacts: "dist/*"

.github/workflows/unit.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
env:
14+
# basic secrets
15+
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
16+
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version:
21+
- "3.8"
22+
- "3.9"
23+
- "3.10"
24+
- "3.11"
25+
- "3.12"
26+
name: "unit test on #${{ matrix.python-version }}"
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
pipx install uv
40+
make venv
41+
42+
- name: Run pytest
43+
run: |
44+
uv run pytest tests/base/unit

0 commit comments

Comments
 (0)