Move authentication logic out of the daphne crate #2503
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2024 Cloudflare, Inc. All rights reserved. | |
# SPDX-License-Identifier: BSD-3-Clause | |
--- | |
name: DaphneCI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
Testing: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out | |
uses: actions/checkout@v3 | |
- name: Setting up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: clippy, rustfmt | |
override: true | |
- name: Cargo hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Cap'n'proto | |
run: sudo apt install capnproto | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v1 | |
- name: Format | |
run: cargo fmt --all --check | |
- name: Documentation | |
run: RUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps --all-features --workspace | |
- name: Build | |
run: cargo build --all-targets | |
- name: Linting | |
run: cargo hack clippy --locked --each-feature -- -D warnings | |
- name: Linting Tests | |
run: cargo hack clippy --tests --locked --each-feature -- -D warnings | |
- name: Testing | |
run: cargo test | |
- name: Doc Testing | |
run: cargo test --doc | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out | |
uses: actions/checkout@v3 | |
- name: Generate HPKE Signing Key | |
id: hpke_signing_key | |
run: | | |
key=$(openssl ecparam -name prime256v1 -genkey -noout -out -) | |
{ | |
echo "hpke_signing_key<<EEEEEOF" | |
echo "$key" | |
echo "EEEEEOF" | |
} >> "$GITHUB_OUTPUT" | |
- name: Generate HPKE Signing Certificate | |
id: hpke_signing_cert | |
run: | | |
echo "${{ steps.hpke_signing_key.outputs.hpke_signing_key }}" > private-key | |
cert=$(openssl req -key private-key \ | |
-new -x509 -days 365 -out - \ | |
-subj '/C=PT/L=Braga/O=Cloudflare Lda/CN=helper.dap.cloudflare.com') | |
{ | |
echo "hpke_signing_cert<<EEEEEOF" | |
echo "$cert" | |
echo "EEEEEOF" | |
} >> "$GITHUB_OUTPUT" | |
- name: Run integration tests | |
uses: hoverkraft-tech/compose-action@v2.0.1 | |
with: | |
compose-file: "./crates/daphne-server/docker-compose-e2e.yaml" | |
up-flags: "--build --abort-on-container-exit --exit-code-from test" | |
env: | |
HPKE_SIGNING_KEY: ${{ steps.hpke_signing_key.outputs.hpke_signing_key }} | |
E2E_TEST_HPKE_SIGNING_CERTIFICATE: ${{ steps.hpke_signing_cert.outputs.hpke_signing_cert }} |