Dance #5711
This file contains hidden or 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: Dance | |
| on: | |
| pull_request: | |
| types: | |
| - unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild | |
| - opened | |
| - reopened | |
| - synchronize | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "12 3 * * *" # after FerretDB's Packages 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 | |
| GOTOOLCHAIN: local | |
| jobs: | |
| dance: | |
| name: ${{ matrix.config }} | |
| # https://www.ubicloud.com/docs/github-actions-integration/price-performance | |
| # https://www.ubicloud.com/docs/about/pricing#github-actions | |
| # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#per-minute-rates | |
| runs-on: ubicloud-standard-8 | |
| timeout-minutes: 45 | |
| # Do not run this job in parallel for any PR change or branch push | |
| # to save some resources. | |
| concurrency: | |
| group: ${{ github.workflow }}-dance-${{ matrix.config }}-${{ 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: | |
| include: | |
| - { config: dotnet-example } | |
| - { config: java-example } | |
| - { config: nodejs-example } | |
| - { config: python-example } | |
| - { config: mongo-tools } | |
| - { config: mongo-core-test, verbose: true } # verbose to view test output on CI | |
| - { config: ycsb-workloada } | |
| - { config: ycsb-workloada2 } | |
| - { config: ycsb-workloadb } | |
| - { config: ycsb-workloadb2 } | |
| - { config: ycsb-workloadc } | |
| - { config: ycsb-workloadc2 } | |
| steps: | |
| - name: Install Tailscale | |
| if: github.event_name != 'pull_request' | |
| uses: tailscale/github-action@v3 | |
| with: | |
| oauth-client-id: ${{ secrets.TAILSCALE_CLIENT_ID }} | |
| oauth-secret: ${{ secrets.TAILSCALE_SECRET }} | |
| tags: tag:ci | |
| version: latest | |
| - name: Create directory for logs | |
| run: mkdir -p /tmp/logs | |
| - name: Start pinging Tailscale | |
| if: github.event_name != 'pull_request' | |
| run: tailscale ping -c 0 --until-direct --timeout 2s --verbose ${{ secrets.DANCE_PUSH_HOST }} 2>&1 > /tmp/logs/tailscale.txt & | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Setup Go | |
| uses: FerretDB/github-actions/setup-go@main | |
| with: | |
| cache-key: dance | |
| - name: Install Task | |
| run: go generate -x | |
| working-directory: tools | |
| - name: Start environment | |
| run: bin/task env-up-detach | |
| - name: Run init | |
| run: bin/task init build | |
| - name: Dance! | |
| run: bin/task dance CONFIG=${{ matrix.config }}.yml VERBOSE_FLAG=${{ matrix.verbose || 'false' }} | |
| env: | |
| DANCE_PUSH: ${{ secrets.DANCE_PUSH }} | |
| - name: Setup nushell | |
| if: failure() | |
| uses: FerretDB/github-actions/setup-nushell@main | |
| - name: Show Docker ports | |
| if: failure() | |
| run: docker compose ps -a --no-trunc | |
| - name: Show listening ports | |
| if: failure() | |
| shell: /usr/local/bin/nu {0} | |
| run: | | |
| docker compose ps -a --format json | | |
| from json -o | | |
| get Publishers | | |
| flatten | | |
| where PublishedPort != 0 | | |
| get PublishedPort | | |
| uniq | | |
| each { |port| lsof -nPi $':($port)' +c0 } | |
| - name: Collect logs | |
| if: failure() | |
| run: bin/task env-logs-collect > /tmp/logs/compose.txt | |
| - name: Compress logs before upload | |
| if: failure() | |
| run: zip -r -q -9 logs.zip /tmp/logs | |
| - name: Upload logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: logs-${{ matrix.config }} | |
| path: logs.zip | |
| retention-days: 3 | |
| # 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 |