forked from jetkvm/kvm
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (70 loc) · 2.37 KB
/
build.yml
File metadata and controls
71 lines (70 loc) · 2.37 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
name: build image
on:
push:
branches:
- dev
- main
workflow_dispatch:
pull_request_review:
types: [submitted]
jobs:
build:
runs-on: ubuntu-latest
name: Build
if: github.event_name != 'pull_request_review' || github.event.review.state == 'approved'
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up docker image context
run: |
./scripts/ci_helper.sh prepare
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build docker image
uses: docker/build-push-action@v6
with:
context: ${{ env.DOCKER_BUILD_CONTEXT_DIR }}
file: ${{ env.DOCKER_BUILD_CONTEXT_DIR }}/Dockerfile.build
tags: ${{ env.DOCKER_BUILD_TAG }}
push: false
load: true
- name: Set up Cmake cache
uses: actions/cache@v4
with:
path: internal/native/cgo/build
key: jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }}
restore-keys: |
jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }}
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Set up Golang
uses: actions/setup-go@v6
with:
go-version: "^1.25.1"
- name: Build frontend
run: |
make frontend
- name: Build application inside Docker container
run: |
./scripts/ci_helper.sh make build_dev
- name: Run tests
run: |
go test ./... -json > testreport.json
- name: Make test cases
run: |
./scripts/ci_helper.sh make build_dev_test
- name: Golang Test Report
uses: becheran/go-testreport@v0.3.2
with:
input: "testreport.json"
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: jetkvm-app
path: |
bin/jetkvm_app
device-tests.tar.gz