Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

updating github action workflows #216

Merged
merged 5 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,43 @@ on:
branches: [ main ]

jobs:
build-go:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./go

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Go environment
uses: actions/setup-go@v2.1.4
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.19'

- name: Set envs
run: |
go env -w GOPATH=$GITHUB_WORKSPACE
go env -w GO111MODULE=auto
cd go
make init
go mod tidy -compat=1.17
go test ./...

- name: Check go mod status
run: |
make gomod_tidy
if [[ ! -z $(git status -s) ]]
then
echo "Go mod state is not clean"
git diff "$GITHUB_SHA"
exit 1
fi

- name: Build binary
run: make build

- name: Run Go tests
run: make test

- name: Run Gosec Security Scanner
working-directory: ./
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install github.com/securego/gosec/v2/cmd/gosec@v2.14.0
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/checkLang.yml

This file was deleted.

34 changes: 13 additions & 21 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
ifdef OS
CP = copy
DEST_DIR = .\pkg\utils\langfiles\resources
LANG_FILE = ..\resources\languages.yml
CUSTOM_LANG_FILE = ..\resources\languages-customization.yml
else
CP = cp -f
DEST_DIR = ./pkg/utils/langfiles/resources
LANG_FILES = ../resources/languages.yml ../resources/languages-customization.yml
endif
.PHONY: gomod_tidy
gomod_tidy:
go mod tidy

init: copy build
initWin: copyWin buildWin

copy:
mkdir -p $(DEST_DIR); for u in $(LANG_FILES); do $(CP) $$u $(DEST_DIR); done

copyWin:
mkdir $(DEST_DIR)
$(CP) $(LANG_FILE) $(DEST_DIR)
$(CP) $(CUSTOM_LANG_FILE) $(DEST_DIR)
.PHONY: gofmt
gofmt:
go fmt -x ./...

.PHONY: build
build:
go build -o alizer

.PHONY: buildWin
buildWin:
go build -o alizer.exe
go build -o alizer.exe

.PHONY: test
test:
go test ./...
67 changes: 0 additions & 67 deletions resources/languages-customization.yml

This file was deleted.

Loading