-
Notifications
You must be signed in to change notification settings - Fork 110
109 lines (108 loc) · 3.61 KB
/
server-32bit.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
on:
push:
jobs:
docker:
runs-on: buildjet-4vcpu-ubuntu-2204-arm
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
file: etc/packaging/32bit/Dockerfile
tags: ghcr.io/viamrobotics/viam-server:armv7
pull: true
push: true
cache-from: type=registry,ref=ghcr.io/viamrobotics/viam-server:buildcache
cache-to: type=registry,ref=ghcr.io/viamrobotics/viam-server:buildcache
lint:
needs: [docker]
runs-on: buildjet-4vcpu-ubuntu-2204-arm
permissions:
packages: read
steps:
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
# note: we're linting on 32-bit because atomicalign analyzer only works on 32-bit architecture
- name: lint
run: docker run --rm -v $PWD/:/rdk ghcr.io/viamrobotics/viam-server:armv7 make lint-32bit
- id: changed-files
uses: tj-actions/changed-files@v39
with:
# note: this doesn't provide perfect coverage, but it's a compromise between running all the time + never running
since_last_remote_commit: true
- name: vendorlint
if: contains(steps.changed-files.outputs.modified_files, 'go.sum')
run: docker run --rm -v $PWD/:/rdk ghcr.io/viamrobotics/viam-server:armv7 make vendorlint
test:
needs: [docker]
runs-on: buildjet-4vcpu-ubuntu-2204-arm
strategy:
fail-fast: false
matrix:
index: ['0', '1', '2', '3', '4']
permissions:
packages: read
steps:
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- name: test
run: |
docker run --rm \
-v $PWD/:/rdk \
--env GOFLAGS="-tags=no_tflite,no_pigpio -buildvcs=false" \
ghcr.io/viamrobotics/viam-server:armv7 \
sh -c "go version && go list -json ./... | etc/splitter.py ${{ matrix.index }} --nbins 5 --command \"go test\" --fail-empty"
build:
needs: [test, lint]
runs-on: buildjet-4vcpu-ubuntu-2204-arm
permissions:
packages: read
steps:
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- name: build
run: docker run --rm -v $PWD/:/rdk ghcr.io/viamrobotics/viam-server:armv7 sh -c "git config --global --add safe.directory '*' && go build -v -tags no_pigpio,no_tflite ./web/cmd/server"
- name: show arch
run: file server
- uses: actions/upload-artifact@v3
with:
path: server
upload:
needs: [build]
if: github.ref_name == 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: rename
run: mv artifact/server viam-server-latest-armv7l
- name: Authorize GCP Upload
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: upload
uses: google-github-actions/[email protected]
with:
headers: "cache-control: no-cache"
path: viam-server-latest-armv7l
destination: 'packages.viam.com/apps/viam-server/'
parent: false