Skip to content

Commit 3b1177b

Browse files
committed
add files
1 parent 76db892 commit 3b1177b

File tree

2 files changed

+151
-0
lines changed

2 files changed

+151
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master", "*" ]
17+
pull_request:
18+
branches: [ "master", "*" ]
19+
schedule:
20+
- cron: '35 23 * * 5'
21+
workflow_call:
22+
inputs:
23+
ref:
24+
required: true
25+
type: string
26+
27+
jobs:
28+
analyze:
29+
name: Analyze ${{ matrix.language }}
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 360
32+
permissions:
33+
# required for all workflows
34+
security-events: write
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
actions: read
38+
contents: read
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
- language: python
44+
- language: actions
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
with:
50+
ref: ${{ inputs.ref }}
51+
persist-credentials: false
52+
- name: Set up Python
53+
uses: actions/setup-python@v4
54+
with:
55+
python-version: 3.x
56+
57+
# Initializes the CodeQL tools for scanning.
58+
- name: Initialize CodeQL
59+
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3
60+
with:
61+
languages: ${{ matrix.language }}
62+
build-mode: none
63+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
64+
queries: security-extended
65+
config: |
66+
paths-ignore:
67+
- 'test/**'
68+
69+
- shell: bash
70+
if: matrix.language == 'python'
71+
run: |
72+
pip install -e .
73+
74+
- name: Perform CodeQL Analysis
75+
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3
76+
with:
77+
category: "/language:${{ matrix.language }}"

.github/workflows/dist.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Python Dist
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
8+
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
9+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
10+
workflow_dispatch:
11+
pull_request:
12+
workflow_call:
13+
inputs:
14+
ref:
15+
required: true
16+
type: string
17+
18+
concurrency:
19+
group: dist-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
defaults:
23+
run:
24+
shell: bash -eux {0}
25+
26+
jobs:
27+
make_dist:
28+
name: Make Dist
29+
runs-on: macos-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
34+
35+
- uses: actions/setup-python@v5
36+
with:
37+
# Build sdist on lowest supported Python
38+
python-version: '3.9'
39+
40+
- name: Install python requirements
41+
run: |
42+
python -m pip install uv rust-just build
43+
44+
- name: Build Dist
45+
run: |
46+
python -m build .
47+
48+
- name: Test SDist
49+
run: |
50+
python -m pip install dist/*.gz
51+
cd ..
52+
python -c "from pymongo_voyageai import PyMongoVoyageAI"
53+
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: "dist"
57+
path: ./dist/*.*
58+
59+
collect_dist:
60+
runs-on: ubuntu-latest
61+
needs: [make_dist]
62+
name: Download Dist
63+
steps:
64+
- name: Download all workflow run artifacts
65+
uses: actions/download-artifact@v4
66+
- name: Flatten directory
67+
working-directory: .
68+
run: |
69+
find . -mindepth 2 -type f -exec mv {} . \;
70+
find . -type d -empty -delete
71+
- uses: actions/upload-artifact@v4
72+
with:
73+
name: all-dist-${{ github.run_id }}
74+
path: "./*"

0 commit comments

Comments
 (0)