simplify logging and remove udp-listeners by default #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Test | |
| on: | |
| push: | |
| branches: [latest, main] | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - '.github/workflows/test.yml' | |
| pull_request: | |
| branches: [latest, main] | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - '.github/workflows/test.yml' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25.2' | |
| - name: Installing dependencies | |
| run: sudo apt install curl | |
| - name: Building proxy-forwarder | |
| run: bash scripts/build.sh | |
| - name: Build squid-container | |
| run: docker build -f test/Dockerfile -t squid test/ | |
| - name: Starting squid | |
| run: | | |
| docker run -d --volume /tmp/squid/:/var/log/squid/ squid | |
| # wait for init to finish | |
| sleep 5 | |
| - name: Configuring NAT | |
| run: | | |
| runner_uid="$UID" | |
| sudo nft list ruleset | |
| sudo nft 'add table inet test' | |
| sudo nft 'add chain inet test output_dnat { type nat hook output priority -100; }' | |
| sudo nft "add rule inet test output_dnat meta l4proto tcp ip daddr 1.1.1.1 meta skuid $runner_uid dnat to 127.0.0.1:4128" | |
| sudo nft "add rule inet test output_dnat meta l4proto tcp ip6 daddr 2606:4700:4700::1111 meta skuid $runner_uid dnat to [::1]:4129" | |
| - name: Run tests | |
| run: | | |
| sudo build/proxy-forwarder-linux-amd64 -P 4128 -F http://127.0.0.1:3128 > /tmp/fwd1.log & | |
| sudo build/proxy-forwarder-linux-amd64 -P 4129 -F http://[::1]:3128 > /tmp/fwd2.log & | |
| bash scripts/test.sh |