Skip to content

Commit edd812b

Browse files
committed
Run unit tests on PRs and main commits
Fixes #75
1 parent 4d64d47 commit edd812b

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/scripts/install_buf.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
PROJECT=<your-project-name>
4+
# Use your desired buf version
5+
BUF_VERSION=1.19.0
6+
# buf is installed to ~/bin/your-project-name.
7+
BIN_DIR=$HOME/bin/$PROJECT
8+
9+
curl -sSL \
10+
"https://github.com/bufbuild/buf/releases/download/v$BUF_VERSION/buf-$(uname -s)-$(uname -m)" \
11+
-o "$BIN_DIR/buf"
12+
chmod +x "$BIN_DIR/buf"

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [19.x]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- run: npm ci
23+
- run: ./.github/scripts/install_buf.sh
24+
- run: npm run proto
25+
- run: npm run verify

0 commit comments

Comments
 (0)