-
Notifications
You must be signed in to change notification settings - Fork 80
84 lines (71 loc) · 2.36 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# The "build" workflow
build:
strategy:
matrix:
# Include amd64 on all platforms.
goos: [linux]
goarch: [amd64]
fail-fast: false
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: 0
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Show workflow information
id: get_filename
run: |
export _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM\"].friendlyName" -r < release/friendly-filenames.json)
echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, RELEASE_NAME: $_NAME"
echo "::set-output name=ASSET_NAME::$_NAME"
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.1
cache: true
- uses: actions/setup-node@v3
with:
node-version: 16
# Install all the dependencies
- name: Install dependencies
run: |
go version
cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./web/gui/wasm_exec.js
npm install --prefix web/gui build
NODE_ENV=production npm run --prefix web/gui build
GOOS=js GOARCH=wasm go get -u ./...
GOOS=js GOARCH=wasm go build -o ./web/gui/dist/main.wasm ./wasm
# Run build of the application
- name: Run build
run: go build -o lite
# Run testing on the code
- name: Run testing
if: matrix.goos != 'windows'
run: ls -thla lite
- name: Create ZIP archive
run: |
zip -9vr lite-$ASSET_NAME.zip lite
FILE=./lite-$ASSET_NAME.zip
- name: Upload ZIP file to Artifacts
uses: actions/upload-artifact@v2
with:
name: lite-${{ steps.get_filename.outputs.ASSET_NAME }}.zip
path: lite-${{ steps.get_filename.outputs.ASSET_NAME }}.zip