-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (45 loc) · 1.7 KB
/
Copy pathtest.yml
File metadata and controls
47 lines (45 loc) · 1.7 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
name: Docker scenarios
run-name: Docker scenarios
on:
workflow_call:
inputs:
test_scenarios:
description: 'A regexp to select what docker scenarios should be run'
required: false
type: string
default: '.*'
jobs:
docker-scenarios:
runs-on: ubuntu-latest
steps:
-uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: 1.25.1
# Perf event paranoid setting: Not useful to everyone
- name: Update perf_event_paranoid settings
run: sudo sysctl kernel.perf_event_paranoid=1
- name: Run Docker scenarios
run: go test -v -run TestScenarios
env:
TEST_SCENARIOS: ${{ inputs.test_scenarios }}
- name: Create unique artifact name
id: artifact_name
if: failure()
run: |
# Replace special characters with underscores to make it artifact-name safe
SAFE_NAME=$(echo "${{ inputs.test_scenarios }}" | sed 's/[^a-zA-Z0-9]/_/g')
echo "name=docker_scenario_test_data_${SAFE_NAME}_${{ github.run_id }}" >> $GITHUB_OUTPUT
- name: Upload test files
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ steps.artifact_name.outputs.name }}
path: data
- name: Notify Slack
if: failure() && github.ref == 'refs/heads/main'
run: |
curl -X POST "${{ secrets.SLACK_WEBHOOK }}" \
-H 'Content-Type: application/json' \
-d "{'scenarios': '${{ inputs.test_scenarios }}', 'failed_run_url': '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'}"