Skip to content

Commit 2c016ea

Browse files
committed
Add github action for tseting a PR branch on push
1 parent 6377885 commit 2c016ea

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test code
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
# This allows a subsequently queued workflow run to interrupt previous runs
11+
concurrency:
12+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
13+
cancel-in-progress: true
14+
15+
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 5
19+
steps:
20+
21+
- name: Check out repo
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Build and run linter
28+
uses: docker/build-push-action@v5
29+
with:
30+
context: .
31+
file: .docker/Dockerfile
32+
tags: test-chatbot
33+
cache-from: type=gha
34+
cache-to: type=gha,mode=max
35+
outputs: type=docker
36+
37+
- name: Run linter
38+
run: |
39+
docker run --rm --memory=1g \
40+
-v ${{ github.workspace }}:/chatbot_server \
41+
-w /chatbot_server \
42+
lint-chatbot-server \
43+
sh -c "pnpm install --frozen-lockfile && pnpm test"

0 commit comments

Comments
 (0)