Skip to content

Run dbaas_core tests with limited concurrency #2626

Run dbaas_core tests with limited concurrency

Run dbaas_core tests with limited concurrency #2626

Workflow file for this run

---
name: Dance
on:
push:
branches:
- main
pull_request:
types:
- unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild
- opened
- reopened
- synchronize
schedule:
- cron: "12 3 * * *" # after FerretDB's Docker workflow
env:
GOPATH: /home/runner/go
GOCACHE: /home/runner/go/cache
GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint
GOMODCACHE: /home/runner/go/mod
GOPROXY: https://proxy.golang.org
jobs:
dance:
name: dance
runs-on:
labels: ubuntu-22.04
timeout-minutes: 120
# Do not run this job in parallel for any PR change or branch push
# to save some resources.
concurrency:
group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready')
strategy:
fail-fast: false
matrix:
db:
- ferretdb
- mongodb
test:
- dbaas_core
- diff
- dotnet-example
- dotnet-example-auth
- java-example
- java-example-auth
- python-example
- python-example-auth
- mongo
- mongo-go-driver
- mongo-tools
- ycsb-workloada
- ycsb-workloadc
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: dance
# set up Python build environment
- name: Install Python dependencies
run: |
pip3 install pymongo
- name: Install Task
run: go generate -x
working-directory: tools
- name: Start environment
run: bin/task env-up-detach
env:
FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main
DB: ${{ matrix.db }}
- name: Run init
run: bin/task init
# The step that creates or updates the environment variable does not have access to the new value,
# but all subsequent steps in a job will have access.
- name: Set GITHUB_ENV
run: |
if [[ ${{ matrix.test == 'dbaas_core' }} ]]; then
echo "WORKERS=1" >> $GITHUB_ENV
fi
- name: Dance!
run: bin/task dance
env:
DB: ${{ matrix.db }}
TEST: ${{ matrix.test }}
WORKERS: ${{ env.WORKERS }}
- name: Collect logs
if: failure()
run: |
bin/task env-logs-collect > /tmp/compose-logs.txt
- name: Compress logs before upload
if: failure()
run: zip -q -9 compose-logs.zip /tmp/compose-logs.txt
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: compose-logs-${{ matrix.db }}-${{ matrix.test }}
path: compose-logs.zip
retention-days: 1
# ignore `go mod tidy` being applied to the Go driver, etc
- name: Check dirty
run: |
git status --ignore-submodules=none
git diff --ignore-submodules=all --exit-code