Skip to content

Commit

Permalink
CI: add continuous build and PR CI (#42)
Browse files Browse the repository at this point in the history
* CI: add continuous build and PR CI
  • Loading branch information
kbdharun committed Jul 30, 2023
1 parent 49dafd9 commit ff8bb6b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 7 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/go-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Go (PR)

on:
pull_request_target:
branches: [ "main" ]
types: [opened, synchronize, reopened]

jobs:

build:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Install build dependencies
run: |
apt-get update
apt-get install -y pkg-config build-essential
- name: Build
run: go build -o vso

- name: Compress
run: tar -czvf vso.tar.gz vso

- uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "continuous"
prerelease: true
name: "Continuous Build"
files: |
vso.tar.gz
29 changes: 22 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Build
name: Go

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main

steps:
- uses: actions/checkout@v3

Expand All @@ -18,8 +19,22 @@ jobs:
with:
go-version: 1.19

- name: Build
run: go build -v ./...
- name: Install build dependencies
run: |
apt-get update
apt-get install -y pkg-config build-essential
- name: Test
run: go test -v ./...
- name: Build
run: go build -o vso

- name: Compress
run: tar -czvf vso.tar.gz vso

- uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "continuous"
prerelease: true
name: "Continuous Build"
files: |
vso.tar.gz

0 comments on commit ff8bb6b

Please sign in to comment.