This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge esad cli into anomaly-detection (#196)
ESAD Version 0.1 to interact with AD Plugin through cli.
- Loading branch information
Showing
52 changed files
with
6,642 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Publish | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: cli | ||
steps: | ||
- name: Set up Go ubuntu-latest | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
- name: Check out AD CLI | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: --snapshot --skip-publish | ||
workdir: cli | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload macOS(amd64) Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: esad-darwin-amd64 | ||
path: cli/dist/esad_darwin_amd64/esad | ||
|
||
- name: Upload Linux(amd64) Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: esad-linux-amd64 | ||
path: cli/dist/esad_linux_amd64/esad | ||
|
||
- name: Upload Linux(arm64) Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: esad-linux-arm64 | ||
path: cli/dist/esad_linux_arm64/esad | ||
|
||
- name: Upload Windows(i386) Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: esad-windows-386 | ||
path: cli/dist/esad_windows_386/esad.exe | ||
|
||
- name: Upload Windows(amd64) Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: esad-windows-amd64 | ||
path: cli/dist/esad_windows_amd64/esad.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: AD CLI Test and Build | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
defaults: | ||
run: | ||
working-directory: cli | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
go-version: [1.14] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Set up Go ${{ matrix.platform }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Check out AD CLI | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
env: | ||
GOPROXY: "https://proxy.golang.org" | ||
run: go build . | ||
|
||
code-analysis: | ||
defaults: | ||
run: | ||
working-directory: cli | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go ubuntu-latest | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
- name: Check out AD CLI | ||
uses: actions/checkout@v2 | ||
|
||
- name: gofmt | ||
run: gofmt -s -w . | ||
- name: Check for modified files | ||
id: git-check | ||
run: | | ||
echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) | ||
- name: Display unformated changes | ||
if: steps.git-check.outputs.modified == 'true' | ||
run: | | ||
echo "Failed to format using go-fmt". | ||
git diff | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v1 | ||
with: | ||
version: v1.28 | ||
working-directory: cli | ||
|
||
- name: Run coverage | ||
env: | ||
GOPROXY: "https://proxy.golang.org" | ||
run: | | ||
go test ./... -coverprofile=coverage.out | ||
go tool cover -func=coverage.out | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1.0.3 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
file: cli/coverage.out | ||
flags: unittests | ||
name: codecov-umbrella |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# IDE Settings | ||
.idea/* | ||
|
||
#OS Settings | ||
.DS_Store | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
bin | ||
.go | ||
.push-* | ||
.container-* | ||
.dockerfile-* | ||
|
||
/coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This is an example goreleaser.yaml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
project_name: esad | ||
dist: ./dist | ||
before: | ||
hooks: | ||
# You may remove this if you don't use go modules. | ||
- go mod download | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- 386 | ||
- amd64 | ||
- arm | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: 386 | ||
archives: | ||
- | ||
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
checksum: | ||
name_template: '{{ .ProjectName }}_checksums.txt' | ||
snapshot: | ||
name_template: '{{ .ProjectName }}_{{ .Version }}' |
Oops, something went wrong.