-
-
Notifications
You must be signed in to change notification settings - Fork 603
135 lines (118 loc) · 4.97 KB
/
docker-projects-latest.yml
File metadata and controls
135 lines (118 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Tests against Latest Docker Projects
on:
schedule:
# nightly build, at 23:59 CEST
- cron: '59 23 * * *'
jobs:
test_latest_moby:
strategy:
matrix:
rootless-docker: [true, false]
containerd-integration: [true, false]
name: "Core tests using latest moby/moby"
runs-on: 'ubuntu-latest'
continue-on-error: true
steps:
- name: Set the Docker Install type
run: |
echo "docker_install_type=${{ matrix.rootless-docker == true && 'Rootless' || 'Rootful' }}" >> "$GITHUB_ENV"
echo "containerd_integration=${{ matrix.containerd-integration == true && 'containerd' || '' }}" >> "$GITHUB_ENV"
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
id: go
- name: modTidy
run: go mod tidy
- name: Install Nightly Docker
uses: docker/setup-docker-action@master
with:
rootless: ${{ matrix.rootless-docker }}
version: type=image,tag=master
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": ${{ matrix.containerd-integration }}
}
}
- name: go test
timeout-minutes: 30
run: make test-unit
- name: Create slack payload file
if: failure()
run: |
cat <<EOF > ./payload-slack-content.json
{
"tc_project": "testcontainers-go",
"tc_docker_install_type": "${docker_install_type}",
"tc_containerd_integration": "${containerd_integration}",
"tc_github_action_url": "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}",
"tc_github_action_status": "FAILED",
"tc_slack_channel_id": "${{ secrets.SLACK_DOCKER_LATEST_CHANNEL_ID }}"
}
- name: Notify to Slack on failures
if: failure()
id: slack
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
payload-templated: true
payload-file-path: "./payload-slack-content.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DOCKER_LATEST_WEBHOOK }}
test_latest_compose:
strategy:
matrix:
latest_compose_version: [true, false]
latest_compose-spec_version: [true, false]
exclude:
- latest_compose_version: false
latest_compose-spec_version: false
name: "Compose tests using a local copy of the compose and compose-spec projects"
runs-on: 'ubuntu-latest'
continue-on-error: true
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: 'modules/compose/go.mod'
cache-dependency-path: 'modules/compose/go.sum'
id: go
- name: Decide which make goal to use
run: |
if [ "${{ matrix.latest_compose_version }}" = "true" ] && [ "${{ matrix.latest_compose-spec_version }}" = "true" ]; then
echo "make_goal=compose-test-all-latest" >> $GITHUB_ENV
elif [ "${{ matrix.latest_compose_version }}" = "true" ] && [ "${{ matrix.latest_compose-spec_version }}" = "false" ]; then
echo "make_goal=compose-test-latest" >> $GITHUB_ENV
elif [ "${{ matrix.latest_compose_version }}" = "false" ] && [ "${{ matrix.latest_compose-spec_version }}" = "true" ]; then
echo "make_goal=compose-test-spec-latest" >> $GITHUB_ENV
fi
- name: "Run the tests"
timeout-minutes: 30
run: make ${make_goal}
- name: Create slack payload file
if: failure()
run: |
cat <<EOF > ./payload-slack-content.json
{
"tc_project": "testcontainers-go",
"compose_version": "${latest_compose_version}",
"compose-spec_version": "${latest_compose-spec_version}",
"tc_github_action_url": "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}",
"tc_github_action_status": "FAILED",
"tc_slack_channel_id": "${{ secrets.SLACK_DOCKER_LATEST_CHANNEL_ID }}"
}
- name: Notify to Slack on failures
if: failure()
id: slack
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a #v2.1.1
with:
payload-templated: true
payload-file-path: "./payload-slack-content.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_COMPOSE_LATEST_WEBHOOK }}