-
-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (53 loc) · 1.46 KB
/
worker.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
name: worker
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
RUSTDOCFLAGS: -Dwarnings
jobs:
test:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: rustup toolchain install stable --profile default
- name: cargo test
run: cargo test --release -p badgers-worker
- name: cargo test (doctests)
run: cargo test --release --doc -p badgers-worker
- name: cargo clippy
run: cargo clippy -p badgers-worker
- name: rustfmt
run: cargo fmt -p badgers-worker --check
deploy:
needs: [test]
if: github.ref == 'refs/heads/main'
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: rustup toolchain install stable --profile minimal
- name: Enable corepack
run: corepack enable
- name: Use Node 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
cache-dependency-path: badgers-worker/yarn.lock
- run: yarn install --immutable
working-directory: ./badgers-worker
- name: Deploy to Cloudflare
run: npx wrangler deploy
working-directory: ./badgers-worker
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}