-
Notifications
You must be signed in to change notification settings - Fork 10
51 lines (41 loc) · 1.13 KB
/
test.yaml
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
name: Test
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
name: Build ${{ matrix.environment }} worker
strategy:
matrix:
environment:
- dev
- production
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
- name: Set wrangler version
id: wrangler
run: echo "version=$(jq -r .devDependencies.wrangler package.json | cut -c2-)" >> "$GITHUB_OUTPUT"
- name: Install packages
run: yarn install
- name: Build ${{ matrix.environment }} worker
uses: cloudflare/[email protected]
with:
wranglerVersion: ${{ steps.wrangler.outputs.version }}
command: deploy --dry-run --env=${{ matrix.environment }}
test:
runs-on: ubuntu-latest
name: Test worker
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
- name: Install packages
run: yarn install
- name: Test
run: yarn test