-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- improve goroutine management - add "bin_args" config option - update crowdsec and third-party dependencies - refactor build and CI - functional tests Co-authored-by: Shivam Sandbhor <[email protected]> Co-authored-by: Shivam Sandbhor <[email protected]>
- Loading branch information
1 parent
19cc560
commit e900227
Showing
28 changed files
with
948 additions
and
2,306 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,79 @@ | ||
name: Build + tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
go-version: ["1.20.1"] | ||
|
||
name: "Build + tests" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.go-version }}-go- | ||
- name: Build | ||
run: | | ||
make build | ||
- name: Run unit tests | ||
run: | | ||
go install github.com/kyoh86/[email protected] | ||
set -o pipefail | ||
make test | richgo testfilter | ||
- name: Cache virtualenvs | ||
id: cache-pipenv | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
|
||
- name: Install functional test dependencies | ||
run: | | ||
python3 -m pip install --upgrade pipenv wheel | ||
pipenv install --deploy | ||
docker network create net-test | ||
- name: Run functional tests | ||
env: | ||
CROWDSEC_TEST_VERSION: dev | ||
CROWDSEC_TEST_FLAVORS: full | ||
CROWDSEC_TEST_NETWORK: net-test | ||
CROWDSEC_TEST_TIMEOUT: 60 | ||
run: | | ||
pipenv run pytest --durations=0 --color=yes | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.51 | ||
args: --issues-exit-code=1 --timeout 10m | ||
only-new-issues: false |
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
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
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
Oops, something went wrong.