From e4ff4a07454969a5682a23ee4968d9e2478540de Mon Sep 17 00:00:00 2001 From: Igor Gov Date: Thu, 12 Aug 2021 18:04:57 +0300 Subject: [PATCH] Run CI checks in parallel (#210) --- .github/workflows/test.yaml | 39 -------------- .github/workflows/validation.yaml | 84 +++++++++++++++++++++++++++++++ Makefile | 4 +- 3 files changed, 87 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/test.yaml create mode 100644 .github/workflows/validation.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 312db265d..000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: test -on: - pull_request: - branches: - - 'develop' - - 'main' - push: - branches: - - 'develop' - - 'main' -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: '^1.16' - - run: go version - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build CLI - run: make cli - - - shell: bash - run: | - sudo apt-get install libpcap-dev - - - name: Build Agent - run: make agent - - - name: Test - run: make test - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 diff --git a/.github/workflows/validation.yaml b/.github/workflows/validation.yaml new file mode 100644 index 000000000..fdc22923e --- /dev/null +++ b/.github/workflows/validation.yaml @@ -0,0 +1,84 @@ +name: Validations +on: + pull_request: + branches: + - 'develop' + - 'main' + push: + branches: + - 'develop' + - 'main' +jobs: + build-cli: + name: Build CLI + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: '^1.16' + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build CLI + run: make cli + + build-agent: + name: Build Agent + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: '^1.16' + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - shell: bash + run: | + sudo apt-get install libpcap-dev + + - name: Build Agent + run: make agent + + run-tests-cli: + name: Run CLI tests + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: '^1.16' + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Test + run: make test-cli + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + + run-tests-agent: + name: Run Agent tests + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: '^1.16' + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - shell: bash + run: | + sudo apt-get install libpcap-dev + + - name: Test + run: make test-agent + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 diff --git a/Makefile b/Makefile index 3d66f655f..6a83d79ff 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,8 @@ clean-cli: ## Clean CLI. clean-docker: @(echo "DOCKER cleanup - NOT IMPLEMENTED YET " ) -test: ## Run tests. +test-cli: ## Run tests. @echo "running cli tests"; cd cli && $(MAKE) test + +test-agent: ## Run tests. @echo "running agent tests"; cd agent && $(MAKE) test