Skip to content

Commit

Permalink
Merge pull request #7 from Ralim/actions
Browse files Browse the repository at this point in the history
Setting up Github Actions
  • Loading branch information
Ralim authored Jan 3, 2022
2 parents aafcb28 + cb0b176 commit b9c2103
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# workflow name
name: Generate release-artifacts

# on events
on:
release:
types:
- created

# workflow tasks
jobs:
generate:
name: Generate cross-platform builds
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Generate build files
uses: thatisuday/go-cross-build@v1
with:
platforms: "linux/amd64,linux/arm64, darwin/amd64, windows/amd64"
name: "switchhost"
compress: "true"
dest: "dist"
27 changes: 27 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest

# show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [push, pull_request]
name: Unit Tests
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: go test ./...
2 changes: 1 addition & 1 deletion termui/termui.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewTermUI() *TermUI {

grid := tview.NewGrid()
grid.SetRows(-2, -8)
grid.SetColumns(4, 6)
grid.SetColumns(-4, -6)
grid.SetBorders(true)

// Grid contents
Expand Down

0 comments on commit b9c2103

Please sign in to comment.