chore: automation tools #2
Workflow file for this run
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
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- "release/*" | ||
pull_request: | ||
jobs: | ||
test: | ||
name: Unit | ||
runs-on: 'ubuntu-20.04' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '~1.21' | ||
check-latest: true | ||
- run: go version | ||
- run: go mod download | ||
- run: make coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
package-unit: | ||
name: Package Unit | ||
runs-on: 'ubuntu-20.04' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: | ||
- jobsdb | ||
- integration_test/docker_test | ||
- integration_test/kafka_batching | ||
- integration_test/multi_tenant_test | ||
- integration_test/reporting_dropped_events | ||
- integration_test/reporting_error_index | ||
- integration_test/warehouse | ||
- integration_test/tracing | ||
- processor | ||
- regulation-worker | ||
- router | ||
- services | ||
- services/rsources | ||
- suppression-backup-service | ||
- warehouse | ||
include: | ||
- package: services | ||
exclude: services/rsources | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '~1.21' | ||
check-latest: true | ||
- run: go version | ||
- run: go mod download | ||
- name: Package Unit [ ${{ matrix.package }} ] | ||
env: | ||
TEST_KAFKA_CONFLUENT_CLOUD_HOST: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_HOST }} | ||
TEST_KAFKA_CONFLUENT_CLOUD_KEY: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_KEY }} | ||
TEST_KAFKA_CONFLUENT_CLOUD_SECRET: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_SECRET }} | ||
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST }} | ||
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME }} | ||
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING }} | ||
TEST_S3_DATALAKE_CREDENTIALS: ${{ secrets.TEST_S3_DATALAKE_CREDENTIALS }} | ||
BIGQUERY_INTEGRATION_TEST_CREDENTIALS: ${{ secrets.BIGQUERY_INTEGRATION_TEST_CREDENTIALS }} | ||
run: make test exclude="${{ matrix.exclude }}" package=${{ matrix.package }} | ||
- name: Sanitize name for Artifact | ||
run: | | ||
name=$(echo -n "${{ matrix.package }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g') | ||
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV | ||
- name: Upload coverage report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.ARTIFACT_NAME }}-unit | ||
path: coverage.txt | ||
coverage: | ||
name: Coverage | ||
runs-on: 'ubuntu-20.04' | ||
needs: | ||
- warehouse-integration | ||
Check failure on line 82 in .github/workflows/tests.yaml GitHub Actions / TestsInvalid workflow file
|
||
- unit | ||
- package-unit | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '~1.21' | ||
check-latest: true | ||
- name: Download coverage reports | ||
uses: actions/download-artifact@v4 | ||
- name: Merge Coverage | ||
run: | | ||
go install github.com/wadey/gocovmerge@latest | ||
gocovmerge */coverage.txt > coverage.txt | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./coverage.txt | ||
all-green: | ||
name: All | ||
if: always() | ||
runs-on: ubuntu-latest | ||
needs: | ||
- integration | ||
- warehouse-integration | ||
- unit | ||
- package-unit | ||
steps: | ||
- uses: re-actors/[email protected] | ||
with: | ||
jobs: ${{ toJSON(needs) }} |