Skip to content

Commit

Permalink
Add .github (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
sago35 authored Sep 17, 2022
1 parent da6b449 commit f324f59
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Go package

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3

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

- name: Install apt dependencies
if: runner.os == 'Linux'
run: |
sudo apt install --no-install-recommends xorg-dev
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

- name: Build ./cmd/tinydisplay
run: |
go build -v ./cmd/tinydisplay
- name: Publish artifact for ubuntu-latest
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: linux-amd64-zipped
path: |
tinydisplay
- name: Publish artifact for windows-latest
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: windows-amd64-zipped
path: |
tinydisplay.exe
- name: Publish artifact for macos-latest
if: runner.os == 'macOS'
uses: actions/upload-artifact@v2
with:
name: macos-amd64-zipped
path: |
tinydisplay
2 changes: 1 addition & 1 deletion cmd/tinydisplay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {
log.Fatal(err)
}
if n != 2 {
log.Fatal("size format error : n != 2 (%d)", n)
log.Fatalf("size format error : n != 2 (%d)", n)
}

fmt.Printf("tcp:%s:%d\n", *addr, *port)
Expand Down

0 comments on commit f324f59

Please sign in to comment.