Skip to content

integrate-dm

integrate-dm #511

Workflow file for this run

---
name: integrate-dm
on:
schedule:
# times are in UTC
- cron: '19 21 * * *'
pull_request:
branches:
- master
- release-*
paths-ignore:
- '**.html'
- '**.md'
- 'CNAME'
- 'LICENSE'
- 'doc/**'
- 'embed/templates/examples/**'
- 'components/client/**'
- 'components/ctl/**'
- 'components/cluster/**'
- 'components/doc/**'
- 'components/errdoc/**'
- 'components/playground/**'
- 'server/**'
- 'pkg/version/version.go'
- '.github/workflows/integrate-cluster**'
- '.github/workflows/integrate-tiup**'
- '.github/workflows/integrate-playground**'
jobs:
dm:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
cases:
- '--do-cases test_cmd'
- '--do-cases test_upgrade'
- '--native-ssh --do-cases test_cmd'
- '--native-ssh --do-cases test_upgrade'
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.21.x
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
- name: Build build_integration_test
working-directory: ${{ env.working-directory }}
run: |
export GOPATH=${GITHUB_WORKSPACE}/go
export PATH=$PATH:$GOPATH/bin
make build_integration_test
make tiup
- name: Build the docker-compose stack
working-directory: ${{ env.working-directory }}
# with --dev the first run will fail for unknow reason, just retry it and will success now..
run: |
cd ${{ env.working-directory }}/docker
TIUP_CLUSTER_ROOT=${{ env.working-directory }} ./up.sh --daemon --dev --compose ./docker-compose.dm.yml || TIUP_CLUSTER_ROOT=${{ env.working-directory }} ./up.sh --daemon --dev --compose ./docker-compose.dm.yml
- name: Check running containers
run: |
docker ps
df -h
free -h
- name: Run test suite
id: test
working-directory: ${{ env.working-directory }}
run: |
# ensuere docker ssh is ready
sleep 4
# should not use -it
# ref: https://stackoverflow.com/questions/43099116/error-the-input-device-is-not-a-tty
docker exec tiup-cluster-control bash /tiup-cluster/tests/tiup-dm/run.sh ${{ matrix.cases }}
- name: Collect component log
working-directory: ${{ env.working-directory }}
# if: ${{ failure() }}
if: always()
run: |
docker exec tiup-cluster-control bash -c 'mkdir -p /tiup-cluster/logs; [[ -d ~/.tiup/logs ]] && find ~/.tiup/logs -type f -name "*.log" -exec cp {} /tiup-cluster/logs \; || true'
ls ${{ env.working-directory }}
tar czvf ${{ env.working-directory }}/dm.logs.tar.gz ${{ env.working-directory }}/logs/
- name: Upload component log
if: ${{ failure() }}
# if: always()
uses: actions/upload-artifact@v1
with:
name: dm_logs
path: ${{ env.working-directory }}/dm.logs.tar.gz
- name: Output dm debug log
working-directory: ${{ env.working-directory }}
if: ${{ failure() }}
# if: always()
run: |
pwd
docker ps
df -h
free -h
find ${{ env.working-directory }}/logs -type f -exec sh -c 'echo "{}" && cat {} && echo "\n"' \; || true
- name: Upload coverage to Codecov
working-directory: ${{ env.working-directory }}
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -F dm -s ${{ env.working-directory }}/tests/tiup-dm/cover -f '*.out'