Skip to content

Commit ff8bb6b

Browse files
authored
CI: add continuous build and PR CI (#42)
* CI: add continuous build and PR CI
1 parent 49dafd9 commit ff8bb6b

File tree

2 files changed

+63
-7
lines changed

2 files changed

+63
-7
lines changed

.github/workflows/go-pr.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Go (PR)
2+
3+
on:
4+
pull_request_target:
5+
branches: [ "main" ]
6+
types: [opened, synchronize, reopened]
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-latest
12+
container:
13+
image: ghcr.io/vanilla-os/pico:main
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: 1.19
22+
23+
- name: Install build dependencies
24+
run: |
25+
apt-get update
26+
apt-get install -y pkg-config build-essential
27+
28+
- name: Build
29+
run: go build -o vso
30+
31+
- name: Compress
32+
run: tar -czvf vso.tar.gz vso
33+
34+
- uses: softprops/action-gh-release@v1
35+
with:
36+
token: "${{ secrets.GITHUB_TOKEN }}"
37+
tag_name: "continuous"
38+
prerelease: true
39+
name: "Continuous Build"
40+
files: |
41+
vso.tar.gz

.github/workflows/go.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
name: Build
1+
name: Go
22

33
on:
44
push:
55
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
86

97
jobs:
108

119
build:
1210
runs-on: ubuntu-latest
11+
container:
12+
image: ghcr.io/vanilla-os/pico:main
13+
1314
steps:
1415
- uses: actions/checkout@v3
1516

@@ -18,8 +19,22 @@ jobs:
1819
with:
1920
go-version: 1.19
2021

21-
- name: Build
22-
run: go build -v ./...
22+
- name: Install build dependencies
23+
run: |
24+
apt-get update
25+
apt-get install -y pkg-config build-essential
2326
24-
- name: Test
25-
run: go test -v ./...
27+
- name: Build
28+
run: go build -o vso
29+
30+
- name: Compress
31+
run: tar -czvf vso.tar.gz vso
32+
33+
- uses: softprops/action-gh-release@v1
34+
with:
35+
token: "${{ secrets.GITHUB_TOKEN }}"
36+
tag_name: "continuous"
37+
prerelease: true
38+
name: "Continuous Build"
39+
files: |
40+
vso.tar.gz

0 commit comments

Comments
 (0)