/ .github / workflows / egress-test.yaml.yml
egress-test.yaml.yml
 1  name: Egress Tests
 2  
 3  on:
 4    pull_request:
 5      branches: [ main ]
 6      paths:
 7        - 'components/egress/**'
 8        - 'components/internal/**'
 9  
10  permissions:
11    contents: read
12  
13  concurrency:
14    group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15    cancel-in-progress: true
16  
17  jobs:
18    test:
19      runs-on: ubuntu-latest
20      steps:
21        - name: Checkout code
22          uses: actions/checkout@v6
23  
24        - name: Set up Go
25          uses: actions/setup-go@v6
26          with:
27            go-version: '1.24.0'
28  
29        - name: Run Build
30          working-directory: components/egress
31          run: |
32            go vet ./...
33            go build .
34  
35        - name: Run tests
36          working-directory: components/egress
37          run: |
38            go test ./...
39  
40    smoke:
41      runs-on: self-hosted
42      steps:
43        - name: Checkout code
44          uses: actions/checkout@v6
45  
46        - name: Run dns test
47          working-directory: components/egress
48          run: |
49            chmod +x tests/smoke-dns.sh
50            ./tests/smoke-dns.sh
51  
52        - name: Run nft test
53          working-directory: components/egress
54          run: |
55            chmod +x tests/smoke-nft.sh
56            ./tests/smoke-nft.sh
57  
58        - name: Run dynamic ip test
59          working-directory: components/egress
60          run: |
61            chmod +x tests/smoke-dynamic-ip.sh
62            ./tests/smoke-dynamic-ip.sh
63  
64        - name: Run dns upstream probe test
65          working-directory: components/egress
66          run: |
67            chmod +x tests/smoke-dns-upstream-probe.sh
68            ./tests/smoke-dns-upstream-probe.sh
69  
70    bench:
71      runs-on: ubuntu-latest
72      steps:
73        - name: Checkout code
74          uses: actions/checkout@v6
75  
76        - name: Run bench test
77          working-directory: components/egress
78          run: |
79            chmod +x tests/bench-dns-nft.sh
80            ./tests/bench-dns-nft.sh
81          env:
82            BENCH_SAMPLE_SIZE: "20"
83  
84        - name: Upload egress logs
85          if: always()
86          uses: actions/upload-artifact@v7
87          with:
88            name: egress-log-for-bench
89            path: /tmp/egress-logs/
90            retention-days: 5