Skip to content

Commit cd013cf

Browse files
committed
set up github workflows
1 parent 39f0fd5 commit cd013cf

File tree

4 files changed

+79
-42
lines changed

4 files changed

+79
-42
lines changed

.github/workflows/release-python.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,3 @@ jobs:
6262
path: dist/
6363
- name: Publish distribution 📦 to PyPI
6464
uses: pypa/gh-action-pypi-publish@release/v1
65-
with:
66-
repository-url: https://test.pypi.org/legacy/

.github/workflows/test-python.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Python Tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
8+
concurrency:
9+
group: tests-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
defaults:
13+
run:
14+
shell: bash -eux {0}
15+
16+
jobs:
17+
build:
18+
# supercharge/mongodb-github-action requires containers so we don't test other platforms
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
23+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
24+
fail-fast: false
25+
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
persist-credentials: false
30+
- name: Setup Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: "Create MongoDB Replica Set"
35+
run: |
36+
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:latest mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
37+
until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
38+
sleep 1
39+
done
40+
sudo docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
41+
- name: Install package and pytest
42+
run: |
43+
python -m pip install .
44+
python -m pip install pytest
45+
- name: Run the tests
46+
run: |
47+
pytest .

.github/workflows/zizmor.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: GitHub Actions Security Analysis with zizmor
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
zizmor:
11+
name: zizmor latest via Cargo
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
20+
- name: Setup Rust
21+
uses: actions-rust-lang/setup-rust-toolchain@v1
22+
- name: Get zizmor
23+
run: cargo install zizmor
24+
- name: Run zizmor
25+
run: zizmor --format sarif . > results.sarif
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Upload SARIF file
29+
uses: github/codeql-action/upload-sarif@v3
30+
with:
31+
sarif_file: results.sarif
32+
category: zizmor

azure-pipelines.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)