Skip to content

Commit

Permalink
Improve pool and Rust CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Jul 8, 2024
1 parent bcf6f27 commit 1263429
Show file tree
Hide file tree
Showing 11 changed files with 416 additions and 59 deletions.
8 changes: 6 additions & 2 deletions .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ all: workflows/nightly.yml \
workflows/dryrun.yml \
workflows/ls-nightly.yml \
workflows/tests.yml \
workflows/tests-managed-pg.yml \
workflows/tests-pool.yml \
workflows/tests-managed-pg.yml \
workflows/tests-ha.yml \
workflows/tests-pg-versions.yml \
workflows/tests-pg-versions.yml \
workflows/tests-patches.yml

workflows/%.yml: workflows.src/%.tpl.yml workflows.src/%.targets.yml workflows.src/build.inc.yml workflows.src/ls-build.inc.yml
Expand All @@ -19,6 +20,9 @@ workflows/%.yml: workflows.src/%.tpl.yml workflows.src/%.targets.yml workflows.s
workflows.src/tests.tpl.yml: workflows.src/tests.inc.yml
touch $(ROOT)/workflows.src/tests.tpl.yml

workflows.src/tests-pool.tpl.yml: workflows.src/tests.inc.yml
touch $(ROOT)/workflows.src/tests-pool.tpl.yml

workflows.src/tests-managed-pg.tpl.yml: workflows.src/tests.inc.yml
touch $(ROOT)/workflows.src/tests-managed-pg.tpl.yml

Expand Down
1 change: 1 addition & 0 deletions .github/workflows.src/tests-pool.targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data:
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<% from "tests.inc.yml" import build, calc_cache_key -%>

name: Pool Simulation Test

on:
Expand All @@ -7,52 +9,35 @@ on:
- pool-test
paths:
- 'edb/server/connpool/**'
- 'edb/server/conn_pool/**'
- 'tests/test_server_pool.py'
- '.github/workflows/test-pool.yml'
- '.github/workflows/tests-pool.yml'
pull_request:
branches:
- master
paths:
- 'edb/server/connpool/**'
- 'edb/server/conn_pool/**'
- 'tests/test_server_pool.py'
- '.github/workflows/test-pool.yml'
- '.github/workflows/tests-pool.yml'

jobs:
test:
runs-on: ubuntu-latest
concurrency: pool-test

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false

- uses: actions/checkout@v4
if: startsWith(github.ref, 'refs/heads')
with:
repository: edgedb/edgedb-pool-simulation
path: pool-simulation
token: ${{ secrets.GITHUB_CI_BOT_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.2'

- name: Generate requirements.txt
run: |
echo 'uvloop==0.19.0' > requirements.txt
mkdir -p pool-simulation/reports
- name: Handle virtualenv
uses: syphar/[email protected]
id: venv-cache

- name: Install Python dependencies
if: steps.venv-cache.outputs.cache-hit != 'true'
<%- call build() -%>
- name: Compute cache keys
run: |
pip install -r requirements.txt
<< calc_cache_key()|indent >>
<%- endcall %>

- name: Run the pool simulation test
env:
Expand All @@ -69,4 +54,4 @@ jobs:
branch: main
cwd: pool-simulation
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
author_email: 41898282+github-actions[bot]@users.noreply.github.com
6 changes: 3 additions & 3 deletions .github/workflows.src/tests.inc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
id: rust-cache
with:
path: build/rust_extensions
key: edb-rust-v3-${{ hashFiles('.tmp/rust_cache_key.txt') }}
key: edb-rust-v4-${{ hashFiles('.tmp/rust_cache_key.txt') }}
restore-keys: |
edb-rust-v3-
edb-rust-v4-
- name: Handle cached Cython extensions
uses: actions/cache@v4
Expand Down Expand Up @@ -368,7 +368,7 @@
id: rust-cache
with:
path: build/rust_extensions
key: edb-rust-v3-${{ hashFiles('.tmp/rust_cache_key.txt') }}
key: edb-rust-v4-${{ hashFiles('.tmp/rust_cache_key.txt') }}

- name: Restore cached Cython extensions
uses: actions/cache@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests-ha.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions .github/workflows/tests-managed-pg.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/workflows/tests-patches.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/workflows/tests-pg-versions.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1263429

Please sign in to comment.