Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 246 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
repository_dispatch:
types: [ok-to-test-command]
push:
branches:
- main

jobs:

Expand Down Expand Up @@ -740,14 +738,97 @@ jobs:
- name: Run tests
working-directory: libs
run: |
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" --exclude="pavex_session_redis" --exclude="pavex_session_sqlx"
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" --exclude="pavex" --exclude="pavex_session_redis" --exclude="pavex_session_sqlx"
- uses: ./.github/actions/finalize-check
if: ${{ always() && github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run tests (linux)
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
tests_pavex_linux:
name: "Run `pavex` tests (linux)"
runs-on: ubuntu-latest
needs:
- build_clis_linux

permissions:
pull-requests: write
checks: write
# Run if it's a PR on the official repo or a push to `main`
if: |
(github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(
github.event.client_payload.pull_request.head.sha,
github.event.client_payload.slash_command.args.named.sha
)) ||
(github.event_name == 'push' && github.event.repository.full_name == github.repository)
steps:
- name: Checkout repository from source repo
if: |
(github.event_name == 'push' && github.event.repository.full_name == github.repository)
uses: actions/checkout@v5
- name: Checkout repository from fork
if: |
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(
github.event.client_payload.pull_request.head.sha,
github.event.client_payload.slash_command.args.named.sha
)
uses: actions/checkout@v5
with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
- uses: ./.github/actions/create-check
if: ${{ github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run `pavex` tests (linux)
workflow: "Build and store docs artifacts"
run_id: ${{ github.run_id }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust stable toolchain
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
rustflags: ""
cache-workspaces: "./libs -> ./target"
- uses: taiki-e/install-action@cargo-hack
- name: Download pavex CLI artifact
uses: actions/download-artifact@v4
with:
name: pavex_cli_linux
path: ~/.cargo/bin
- name: Download pavexc CLI artifact
uses: actions/download-artifact@v4
with:
name: pavexc_cli_linux
path: ~/.cargo/bin
- name: Mark pavex as executable
env:
PAVEX: /home/runner/.cargo/bin/pavex
PAVEXC: /home/runner/.cargo/bin/pavexc
run: |
chmod +x ${{ env.PAVEX }}
chmod +x ${{ env.PAVEXC }}
- name: Activate pavex
env:
PAVEX_ACTIVATION_KEY: ${{ secrets.pavex_activation_key }}
run: |
pavex self activate
pavexc self setup
- name: Run Pavex tests with multiple feature combinations
working-directory: libs
run: |
cargo hack -p pavex --feature-powerset --depth 2 test --tests
- uses: ./.github/actions/finalize-check
if: ${{ always() && github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run `pavex` tests (linux)
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
ui_tests_linux:
name: "Run UI tests (linux)"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -976,14 +1057,97 @@ jobs:
- name: Run tests
working-directory: libs
run: |
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" --exclude="pavex_session_redis" --exclude="pavex_session_sqlx"
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" --exclude="pavex" --exclude="pavex_session_redis" --exclude="pavex_session_sqlx"
- uses: ./.github/actions/finalize-check
if: ${{ always() && github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run tests (macos)
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
tests_pavex_macos:
name: "Run `pavex` tests (macos)"
runs-on: macos-14
needs:
- build_clis_macos

permissions:
pull-requests: write
checks: write
# Run if it's a PR on the official repo or a push to `main`
if: |
(github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(
github.event.client_payload.pull_request.head.sha,
github.event.client_payload.slash_command.args.named.sha
)) ||
(github.event_name == 'push' && github.event.repository.full_name == github.repository)
steps:
- name: Checkout repository from source repo
if: |
(github.event_name == 'push' && github.event.repository.full_name == github.repository)
uses: actions/checkout@v5
- name: Checkout repository from fork
if: |
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(
github.event.client_payload.pull_request.head.sha,
github.event.client_payload.slash_command.args.named.sha
)
uses: actions/checkout@v5
with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
- uses: ./.github/actions/create-check
if: ${{ github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run `pavex` tests (macos)
workflow: "Build and store docs artifacts"
run_id: ${{ github.run_id }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust stable toolchain
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
rustflags: ""
cache-workspaces: "./libs -> ./target"
- uses: taiki-e/install-action@cargo-hack
- name: Download pavex CLI artifact
uses: actions/download-artifact@v4
with:
name: pavex_cli_macos
path: ~/.cargo/bin
- name: Download pavexc CLI artifact
uses: actions/download-artifact@v4
with:
name: pavexc_cli_macos
path: ~/.cargo/bin
- name: Mark pavex as executable
env:
PAVEX: /Users/runner/.cargo/bin/pavex
PAVEXC: /Users/runner/.cargo/bin/pavexc
run: |
chmod +x ${{ env.PAVEX }}
chmod +x ${{ env.PAVEXC }}
- name: Activate pavex
env:
PAVEX_ACTIVATION_KEY: ${{ secrets.pavex_activation_key }}
run: |
pavex self activate
pavexc self setup
- name: Run Pavex tests with multiple feature combinations
working-directory: libs
run: |
cargo hack -p pavex --feature-powerset --depth 2 test --tests
- uses: ./.github/actions/finalize-check
if: ${{ always() && github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run `pavex` tests (macos)
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
ui_tests_macos:
name: "Run UI tests (macos)"
runs-on: macos-14
Expand Down Expand Up @@ -1206,14 +1370,91 @@ jobs:
- name: Run tests
working-directory: libs
run: |
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" --exclude="pavex_session_redis" --exclude="pavex_session_sqlx"
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" --exclude="pavex" --exclude="pavex_session_redis" --exclude="pavex_session_sqlx"
- uses: ./.github/actions/finalize-check
if: ${{ always() && github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run tests (windows)
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
tests_pavex_windows:
name: "Run `pavex` tests (windows)"
runs-on: windows-2022
needs:
- build_clis_windows

permissions:
pull-requests: write
checks: write
# Run if it's a PR on the official repo or a push to `main`
if: |
(github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(
github.event.client_payload.pull_request.head.sha,
github.event.client_payload.slash_command.args.named.sha
)) ||
(github.event_name == 'push' && github.event.repository.full_name == github.repository)
steps:
- name: Checkout repository from source repo
if: |
(github.event_name == 'push' && github.event.repository.full_name == github.repository)
uses: actions/checkout@v5
- name: Checkout repository from fork
if: |
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(
github.event.client_payload.pull_request.head.sha,
github.event.client_payload.slash_command.args.named.sha
)
uses: actions/checkout@v5
with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
- uses: ./.github/actions/create-check
if: ${{ github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run `pavex` tests (windows)
workflow: "Build and store docs artifacts"
run_id: ${{ github.run_id }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust stable toolchain
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
rustflags: ""
cache-workspaces: "./libs -> ./target"
- uses: taiki-e/install-action@cargo-hack
- name: Download pavex CLI artifact
uses: actions/download-artifact@v4
with:
name: pavex_cli_windows
path: ~/.cargo/bin
- name: Download pavexc CLI artifact
uses: actions/download-artifact@v4
with:
name: pavexc_cli_windows
path: ~/.cargo/bin

- name: Activate pavex
env:
PAVEX_ACTIVATION_KEY: ${{ secrets.pavex_activation_key }}
run: |
pavex self activate
pavexc self setup
- name: Run Pavex tests with multiple feature combinations
working-directory: libs
run: |
cargo hack -p pavex --feature-powerset --depth 2 test --tests
- uses: ./.github/actions/finalize-check
if: ${{ always() && github.event_name != 'push' }}
with:
pr_number: ${{ github.event.client_payload.pull_request.number }}
job: Run `pavex` tests (windows)
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
ui_tests_windows:
name: "Run UI tests (windows)"
runs-on: windows-2022
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/workspace-hack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ jobs:
- name: Fail if any verification failed
if: steps.verify_libs.outcome == 'failure' || steps.verify_examples.outcome == 'failure'
run: |
echo "One or more verification steps failed. Check the logs of the previous steps for details."
echo "Verify workspace-hack in libs: ${{ steps.verify_libs.outcome }}"
echo "Verify workspace-hack in examples: ${{ steps.verify_examples.outcome }}"
exit 1
1 change: 1 addition & 0 deletions ci_utils/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fn main() {
("single_lib_tests_steps", "job_steps/single_lib_tests.jinja"),
("tests_steps", "job_steps/tests.jinja"),
("macro_tests_steps", "job_steps/macro_tests.jinja"),
("pavex_tests_steps", "job_steps/pavex_tests.jinja"),
("ui_tests_steps", "job_steps/ui_tests.jinja"),
("setup_pavex", "setup_pavex.jinja"),
];
Expand Down
10 changes: 8 additions & 2 deletions ci_utils/templates/ci.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
repository_dispatch:
types: [ok-to-test-command]
push:
branches:
- main

jobs:
<%- for (os, target, binary_extension) in [
Expand Down Expand Up @@ -89,6 +87,14 @@ jobs:
<% set job_name %>Run tests (<<- target >>)<% endset %>
<%- from 'tests_steps' import output -%>
<<- output | indent(4) >>
tests_pavex_<<- target >>:
name: "Run `pavex` tests (<<- target >>)"
runs-on: << os >>
needs:
- build_clis_<<- target >>
<% set job_name %>Run `pavex` tests (<<- target >>)<% endset %>
<%- from 'pavex_tests_steps' import output -%>
<<- output | indent(4) >>
ui_tests_<<- target >>:
name: "Run UI tests (<<- target >>)"
runs-on: << os >>
Expand Down
15 changes: 15 additions & 0 deletions ci_utils/templates/job_steps/pavex_tests.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% extends 'steps' %>
<% block inner_steps %>
- name: Install Rust stable toolchain
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
rustflags: ""
cache-workspaces: "./libs -> ./target"
- uses: taiki-e/install-action@cargo-hack
<% include 'setup_pavex' %>
- name: Run Pavex tests with multiple feature combinations
working-directory: libs
run: |
cargo hack -p pavex --feature-powerset --depth 2 test --tests
<%- endblock %>
2 changes: 1 addition & 1 deletion ci_utils/templates/job_steps/tests.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
- name: Run tests
working-directory: libs
run: |
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" << exclude_libs_with_deps >>
cargo test --all-features --workspace --exclude="pavex_cli" --exclude="pavex_macros" --exclude="pavex" << exclude_libs_with_deps >>
<%- endblock %>
1 change: 1 addition & 0 deletions libs/pavex_session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ pavex_session_memory_store = { path = "../pavex_session_memory_store" }
googletest = "0.14.2"
itertools = { workspace = true }
insta = { workspace = true }
tokio = { workspace = true, features = ["rt", "macros"] }
1 change: 1 addition & 0 deletions libs/pavex_session_redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ serde_json = { workspace = true }

[dev-dependencies]
uuid = { workspace = true }
tokio = { workspace = true, features = ["macros"] }
Loading