|
| 1 | +name: Tests against recent Docker engine releases |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + # nightly build, at 23:59 CEST |
| 7 | + - cron: '59 23 * * *' |
| 8 | + |
| 9 | +jobs: |
| 10 | + test_docker: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + install-docker-type: ["STABLE", "ROOTLESS", "ROOTFUL"] |
| 14 | + name: "Core tests using Docker ${{ matrix.install-docker-type }}" |
| 15 | + runs-on: ubuntu-22.04 |
| 16 | + continue-on-error: true |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - uses: ./.github/actions/setup-build |
| 20 | + |
| 21 | + - name: Install Stable Docker |
| 22 | + if: ${{ matrix.install-docker-type == 'STABLE' }} |
| 23 | + run: curl https://get.docker.com |
| 24 | + |
| 25 | + - name: Install Docker from the TEST channel |
| 26 | + if: ${{ matrix.install-docker-type == 'ROOTFUL' }} |
| 27 | + run: curl https://get.docker.com | CHANNEL=test sh |
| 28 | + |
| 29 | + - name: Setup rootless Docker |
| 30 | + if: ${{ matrix.install-docker-type == 'ROOTLESS' }} |
| 31 | + uses: ScribeMD/rootless-docker@6bd157a512c2fafa4e0243a8aa87d964eb890886 # v0.2.2 |
| 32 | + |
| 33 | + - name: Remove Docker root socket |
| 34 | + if: ${{ matrix.install-docker-type == 'ROOTLESS' }} |
| 35 | + run: sudo rm -rf /var/run/docker.sock |
| 36 | + |
| 37 | + - name: Check Docker version |
| 38 | + run: docker version |
| 39 | + |
| 40 | + - name: Build with Gradle |
| 41 | + run: ./gradlew cleanTest --no-daemon --continue --scan -Dscan.tag.DOCKER_${{ matrix.install-docker-type }} testcontainers:test -Dorg.gradle.caching=false |
| 42 | + - uses: ./.github/actions/setup-junit-report |
| 43 | + |
| 44 | + - name: Notify to Slack on failures |
| 45 | + if: failure() |
| 46 | + id: slack |
| 47 | + |
| 48 | + with: |
| 49 | + payload: | |
| 50 | + { |
| 51 | + "tc_project": "testcontainers-java", |
| 52 | + "tc_docker_install_type": "${{ matrix.install-docker-type }}", |
| 53 | + "tc_github_action_url": "https://github.com/testcontainers/testcontainers-java/actions/runs/${{ env.GITHUB_RUN_ID }}/job/${{ env.GITHUB_RUN_NUMBER }}", |
| 54 | + "tc_github_action_status": "FAILED", |
| 55 | + "tc_slack_channel_id": "${{ secrets.SLACK_DOCKER_LATEST_CHANNEL_ID }}" |
| 56 | + } |
| 57 | + env: |
| 58 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DOCKER_LATEST_WEBHOOK }} |
0 commit comments