Skip to content

Commit 3915d2b

Browse files
committed
fix test
1 parent b7b5d37 commit 3915d2b

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

.github/workflows/test-python.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ defaults:
1313
run:
1414
shell: bash -eux {0}
1515

16-
env:
17-
MONGODB_VERSION: "7.0"
18-
1916
jobs:
2017
static:
2118
runs-on: ubuntu-latest
@@ -55,18 +52,16 @@ jobs:
5552
- uses: extractions/setup-just@v2
5653
- name: Start MongoDB on Linux
5754
if: ${{ startsWith(runner.os, 'Linux') }}
58-
run: |
59-
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${MONGODB_VERSION} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
60-
until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
61-
sleep 1
62-
done
63-
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\" }]})"
55+
uses: supercharge/mongodb-github-action@1.12.0
56+
with:
57+
mongodb-version: 8.0
58+
mongodb-replica-set: test-rs
6459
- name: Start MongoDB on MacOS
6560
if: ${{ startsWith(runner.os, 'macOS') }}
6661
run: |
6762
brew tap mongodb/brew
68-
brew install mongodb/brew/mongodb-community@${MONGODB_VERSION}
69-
brew services start mongodb-community@${MONGODB_VERSION}
63+
brew install mongodb/brew/mongodb-community@7.0
64+
brew services start mongodb-community@7.0
7065
- name: Start MongoDB on Windows
7166
if: ${{ startsWith(runner.os, 'Windows') }}
7267
shell: powershell
@@ -77,7 +72,31 @@ jobs:
7772
net start MongoDB
7873
- run: just install
7974
- run: just test
80-
- name: Run unit tests with minimum dependency versions
81-
run: |
82-
uv sync --python=${{ matrix.python-version }} --resolution=lowest-direct
83-
just tests
75+
76+
build-min:
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
with:
81+
persist-credentials: false
82+
fetch-depth: 0
83+
- name: Install uv
84+
uses: astral-sh/setup-uv@v5
85+
with:
86+
enable-cache: true
87+
python-version: "3.9"
88+
- uses: extractions/setup-just@v2
89+
- name: Install uv
90+
uses: astral-sh/setup-uv@v5
91+
with:
92+
enable-cache: true
93+
python-version: "3.9"
94+
- uses: extractions/setup-just@v2
95+
- uses: supercharge/mongodb-github-action@1.12.0
96+
with:
97+
mongodb-version: 4.0
98+
mongodb-replica-set: test-rs
99+
- name: Run unit tests with minimum dependency versions
100+
run: |
101+
uv sync --python="3.9" --resolution=lowest-direct
102+
just tests

0 commit comments

Comments
 (0)