Skip to content

Commit

Permalink
port github actions from jorge
Browse files Browse the repository at this point in the history
  • Loading branch information
facundoolano committed Jul 23, 2024
1 parent a94c9bb commit 5bb6f7b
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Upload release binaries

on:
push:
tags:
- '*'

jobs:
build:
name: Build Binaries
runs-on: ubuntu-latest

strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Build Binary
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w" -o ngtop-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }} .

- name: Release
uses: softprops/action-gh-release@v1
with:
files: "ngtop-*"
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Test project

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

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Build
run: go build -v ./...

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

- name: Vet
run: go vet -v ./...

- name: install staticcheck
run: go install "honnef.co/go/tools/cmd/staticcheck@latest"

- name: staticcheck
run: staticcheck ./...

0 comments on commit 5bb6f7b

Please sign in to comment.