Skip to content

Commit f42d425

Browse files
authored
Decompose the job scheduler (#520)
* make job scheduler more modular * up * Move to traits * up * add redis feature * add basic scheduling test * use minio run by github actions * update cargo-dist * update openidconnect * changes * remove slow test * up * im cryign * new snapshot
1 parent a247eb0 commit f42d425

File tree

77 files changed

+2602
-1718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2602
-1718
lines changed

.github/workflows/coverage.yml

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ jobs:
1212
name: Test coverage
1313
runs-on: ubuntu-latest
1414
services:
15+
minio:
16+
image: bitnami/minio
17+
env:
18+
MINIO_ROOT_USER: minioadmin
19+
MINIO_ROOT_PASSWORD: minioadmin
20+
ports:
21+
- 9000:9000
1522
postgres:
1623
image: postgres
1724
ports:
@@ -46,6 +53,7 @@ jobs:
4653
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info
4754
env:
4855
DATABASE_URL: "postgres://postgres:postgres@localhost/test_db"
56+
MINIO_URL: "http://127.0.0.1:9000"
4957
REDIS_URL: "redis://localhost"
5058
- name: Upload coverage to Codecov
5159
uses: codecov/codecov-action@v4

.github/workflows/release.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Copyright 2022-2023, axodotdev
1+
# Copyright 2022-2024, axodotdev
22
# SPDX-License-Identifier: MIT or Apache-2.0
33
#
44
# CI that:
55
#
66
# * checks for a Git Tag that looks like a release
77
# * builds artifacts with cargo-dist (archives, installers, hashes)
88
# * uploads those artifacts to temporary workflow zip
9-
# * on success, uploads the artifacts to a Github Release
9+
# * on success, uploads the artifacts to a GitHub Release
1010
#
11-
# Note that the Github Release will be created with a generated
11+
# Note that the GitHub Release will be created with a generated
1212
# title/body based on your changelogs.
1313

1414
name: Release
@@ -31,7 +31,7 @@ permissions:
3131
# packages versioned/released in lockstep).
3232
#
3333
# If you push multiple tags at once, separate instances of this workflow will
34-
# spin up, creating an independent announcement for each one. However Github
34+
# spin up, creating an independent announcement for each one. However, GitHub
3535
# will hard limit this to 3 tags per commit, as it will assume more tags is a
3636
# mistake.
3737
#
@@ -62,7 +62,7 @@ jobs:
6262
# we specify bash to get pipefail; it guards against the `curl` command
6363
# failing. otherwise `sh` won't catch that `curl` returned non-0
6464
shell: bash
65-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.12.0/cargo-dist-installer.sh | sh"
65+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.2/cargo-dist-installer.sh | sh"
6666
# sure would be cool if github gave us proper conditionals...
6767
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
6868
# functionality based on whether this is a pull_request, and whether it's from a fork.
@@ -109,6 +109,8 @@ jobs:
109109
with:
110110
submodules: recursive
111111
- uses: swatinem/rust-cache@v2
112+
with:
113+
key: ${{ join(matrix.targets, '-') }}
112114
- name: Install cargo-dist
113115
run: ${{ matrix.install_dist }}
114116
# Get the dist-manifest
@@ -135,7 +137,7 @@ jobs:
135137
run: |
136138
# Parse out what we just built and upload it to scratch storage
137139
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
138-
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT"
140+
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
139141
echo "EOF" >> "$GITHUB_OUTPUT"
140142
141143
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -162,7 +164,7 @@ jobs:
162164
submodules: recursive
163165
- name: Install cargo-dist
164166
shell: bash
165-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.12.0/cargo-dist-installer.sh | sh"
167+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.2/cargo-dist-installer.sh | sh"
166168
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
167169
- name: Fetch local artifacts
168170
uses: actions/download-artifact@v4
@@ -178,7 +180,7 @@ jobs:
178180
179181
# Parse out what we just built and upload it to scratch storage
180182
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
181-
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT"
183+
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
182184
echo "EOF" >> "$GITHUB_OUTPUT"
183185
184186
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -207,15 +209,15 @@ jobs:
207209
with:
208210
submodules: recursive
209211
- name: Install cargo-dist
210-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.12.0/cargo-dist-installer.sh | sh"
212+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.2/cargo-dist-installer.sh | sh"
211213
# Fetch artifacts from scratch-storage
212214
- name: Fetch artifacts
213215
uses: actions/download-artifact@v4
214216
with:
215217
pattern: artifacts-*
216218
path: target/distrib/
217219
merge-multiple: true
218-
# This is a harmless no-op for Github Releases, hosting for that happens in "announce"
220+
# This is a harmless no-op for GitHub Releases, hosting for that happens in "announce"
219221
- id: host
220222
shell: bash
221223
run: |
@@ -230,7 +232,7 @@ jobs:
230232
name: artifacts-dist-manifest
231233
path: dist-manifest.json
232234

233-
# Create a Github Release while uploading all files to it
235+
# Create a GitHub Release while uploading all files to it
234236
announce:
235237
needs:
236238
- plan
@@ -246,7 +248,7 @@ jobs:
246248
- uses: actions/checkout@v4
247249
with:
248250
submodules: recursive
249-
- name: "Download Github Artifacts"
251+
- name: "Download GitHub Artifacts"
250252
uses: actions/download-artifact@v4
251253
with:
252254
pattern: artifacts-*
@@ -256,7 +258,7 @@ jobs:
256258
run: |
257259
# Remove the granular manifests
258260
rm -f artifacts/*-dist-manifest.json
259-
- name: Create Github Release
261+
- name: Create GitHub Release
260262
uses: ncipollo/release-action@v1
261263
with:
262264
tag: ${{ needs.plan.outputs.tag }}

.github/workflows/rust.yml

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ jobs:
3939
name: Test
4040
runs-on: ubuntu-latest
4141
services:
42+
minio:
43+
image: bitnami/minio
44+
env:
45+
MINIO_ROOT_USER: minioadmin
46+
MINIO_ROOT_PASSWORD: minioadmin
47+
ports:
48+
- 9000:9000
4249
postgres:
4350
image: postgres
4451
ports:
@@ -71,4 +78,5 @@ jobs:
7178
- run: nix develop --impure --command bash -c "unset LD_LIBRARY_PATH && cargo nextest run --all-features"
7279
env:
7380
DATABASE_URL: "postgres://postgres:postgres@localhost/test_db"
81+
MINIO_URL: "http://127.0.0.1:9000"
7482
REDIS_URL: "redis://localhost"

0 commit comments

Comments
 (0)