-
Notifications
You must be signed in to change notification settings - Fork 27
82 lines (76 loc) · 2.54 KB
/
daphneci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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: Machete
uses: bnjbvr/cargo-machete@main
- 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: 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/[email protected]
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 }}