Skip to content

Commit

Permalink
add unittest
Browse files Browse the repository at this point in the history
Signed-off-by: Aneesh Puttur <[email protected]>
  • Loading branch information
aneeshkp committed Feb 6, 2025
1 parent 53eed57 commit 751ed30
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Revive Action by pulling pre-built image
- name: Run Revive Action by pulling pre-built image for test
uses: docker://morphy/revive-action:v2
with:
exclude: "./vendor/..."
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Test linuxptp daemon

on: [push, pull_request]

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

build:
name: build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.22
uses: actions/setup-go@v3
with:
go-version: 1.22.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: fmt
run: IS_CONTAINER=yes make fmt

- name: Build
run: make all

test:
name: test
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.22.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: test
run: make test-

modules:
name: check go modules
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.22.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: check go modules are up to date
run: make check-deps

golangci:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.22.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.55.2

shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: error

test-coverage:
name: test-coverage
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.22.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: test
run: make test

- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.out

0 comments on commit 751ed30

Please sign in to comment.