DSET-4359: Fix flaky tests #356
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: Check code quality | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '0 4 * * *' | |
permissions: | |
actions: write # Needed for skip-duplicate-jobs job | |
contents: read | |
jobs: | |
# Special job which automatically cancels old runs for the same branch, prevents runs for the | |
# same file set which has already passed, etc. | |
pre_job: | |
name: Skip Duplicate Jobs Pre Job | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 # v5.3.0 | |
with: | |
cancel_others: 'true' | |
github_token: ${{ github.token }} | |
build: | |
runs-on: ubuntu-latest | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref_name == 'main' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
cache: true | |
cache-dependency-path: | | |
go.sum | |
examples/**/go.sum | |
- name: Install pre-commit | |
run: | | |
python -m pip install -U pip | |
python -m pip install pre-commit | |
- name: Install pre-commit hooks | |
run: | | |
pre-commit install | |
- name: Install Go tools | |
run: | | |
./scripts/install-dev-tools.sh | |
- name: Run go mod vendor | |
run: | | |
go mod vendor | |
- name: Run pre-commit | |
run: | | |
pre-commit run -a | |
- name: Code tests | |
run: | | |
make test | |
- name: Code coverage | |
run: | | |
make coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true | |
- name: Build Examples | |
run: | | |
( cd examples/client; go build ) | |
( cd examples/readme; go build ) | |
- name: Check SSL Certificates | |
run: | | |
cd scripts | |
./test-ssl-certificates.sh | |
- name: Run Tests Many Times | |
# Run test multiple times to check for data races | |
if: github.ref_name == 'main' | |
run: | | |
set -e; | |
N=10; | |
for i in `seq 1 ${N}`; do | |
echo "Running test ${i} / ${N}"; | |
make test; | |
done; |