mirror of https://github.com/jetkvm/kvm.git
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
name: build image
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- main
|
|
workflow_dispatch:
|
|
pull_request_review:
|
|
types: [submitted]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: buildjet-4vcpu-ubuntu-2204
|
|
name: Build
|
|
if: "github.event.review.state == 'approved' || github.event.event_type != 'pull_request_review'"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up Cmake cache
|
|
uses: buildjet/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@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: "npm"
|
|
cache-dependency-path: "**/package-lock.json"
|
|
- name: Set up Golang
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.24.4"
|
|
- name: Build frontend
|
|
run: |
|
|
make frontend
|
|
- name: Build application
|
|
run: |
|
|
make build_dev
|
|
- name: Run tests
|
|
run: |
|
|
go test ./... -json > testreport.json
|
|
- name: Make test cases
|
|
run: |
|
|
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@v4
|
|
with:
|
|
name: jetkvm-app
|
|
path: |
|
|
bin/jetkvm_app
|
|
device-tests.tar.gz |