Skip to content

Commit

Permalink
Version 1.0.0 (#2)
Browse files Browse the repository at this point in the history
* refactor & testing
* testing
* update gitignore
  • Loading branch information
mikenye authored Feb 18, 2024
1 parent 1bfae0d commit 7ac9e8d
Show file tree
Hide file tree
Showing 11 changed files with 86,955 additions and 196 deletions.
19 changes: 19 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
assignees:
- "mikenye"

# Maintain dependencies for pw-feeder go modules
- package-ecosystem: "gomod"
directory: "/pw-feeder"
schedule:
interval: "daily"
assignees:
- "mikenye"
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Upload Release Asset

on:
workflow_dispatch:

jobs:
codecov:
runs-on: ubuntu-latest
name: Codecov
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go test"
run: |
go test -v -failfast -timeout=300s -count=2 -coverprofile=coverage.txt ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

upload:
needs: codecov
strategy:
matrix:
os: [linux]
arch: [amd64,arm64]
name: Upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go build"
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build ./cmd/sbsmux
tar cJvf ../sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.tar.xz ./sbsmux
rm -v ./sbsmux
- name: Upload binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.tar.xz
56 changes: 56 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Pull Request

on:
# Enable manual running of action if necessary
workflow_dispatch:
# Test build/deploy on PRs to main/master
pull_request:
# Only publish on push to main branch
branches:
- main
# Don't trigger if it's just a documentation update
paths-ignore:
- '**.md'
- '**.MD'
- '**.yml'
- '.gitattributes'
- '.gitignore'
push:
# Only publish on push to main branch
branches:
- main
# Don't trigger if it's just a documentation update
paths-ignore:
- '**.md'
- '**.MD'
- '**.yml'
- '.gitattributes'
- '.gitignore'

jobs:

tests:
name: Test sbsmux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go test"
run: |
go test -v -failfast -timeout=300s -count=2 -coverprofile=coverage.txt ./...
- name: "application testing"
run: |
sudo apt-get update -y
sudo apt-get install pv -y
bash ./test.sh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: "go build"
run: |
go build ./...
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./bin
bin
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ install_modules:
mkbindir:
@mkdir -p ./bin

test:
go test -v -failfast -count=2 -timeout=5m ./...
bash ./test.sh

clean:
@rm -v ./bin/sbsmux > /dev/null 2>&1 || true
@rmdir -v ./bin > /dev/null 2>&1 || true
Loading

0 comments on commit 7ac9e8d

Please sign in to comment.