forked from cloudflare/web-bot-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (85 loc) · 2.65 KB
/
Copy pathpullrequest.yml
File metadata and controls
91 lines (85 loc) · 2.65 KB
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
83
84
85
86
87
88
89
90
91
name: Pull Request
on:
push:
pull_request:
jobs:
test-typescript:
name: Test TypeScript
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run test
test-rust:
name: Test Rust
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set rust toolchain
run: rustup component add clippy rustfmt && rustup target add wasm32-unknown-unknown
- run: cargo fetch
- run: cargo build --all --verbose --all-features --tests
- run: cargo build --all --verbose --exclude http-signature-directory --all-features --tests --target wasm32-unknown-unknown
- run: cargo check --tests --examples --benches --all-features
- run: cargo clippy --all-features --all-targets -- -D warnings
- run: cargo fmt --all -- --check
- run: cargo doc --all --all-features --document-private-items
- run: cargo test --all --verbose --all-features
deploy-rust:
name: Deploy Rust Crates
timeout-minutes: 5
env:
# This token can be regenerated by visiting https://crates.io/me,
# generating a new API token with `publish-update` permissions,
# scoping it to just `web-bot-auth` and `http-signature-directory`
# crates, and uploading to Github.
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
strategy:
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- "test-rust"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: cargo publish -p web-bot-auth # will fail if we don't bump the version
continue-on-error: true
- run: cargo publish -p http-signature-directory # will fail if we don't bump the version
continue-on-error: true