add bats tests and fix udp on mac and windows #18
Workflow file for this run
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: bats | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| GO_VERSION: "1.23" | |
| K8S_VERSION: "v1.32.0" | |
| KIND_VERSION: "v0.27.0" | |
| jobs: | |
| bats_tests: | |
| runs-on: ubuntu-22.04 | |
| name: Bats e2e tests | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Bats and bats libs | |
| id: setup-bats | |
| uses: bats-core/bats-action@3.0.0 | |
| - name: Bats tests | |
| shell: bash | |
| env: | |
| BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }} | |
| TERM: xterm | |
| run: bats -o _artifacts tests/ | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }} | |
| path: ./_artifacts | |
| bats_mac_tests: | |
| runs-on: macos-15 | |
| name: Bats e2e tests on Mac | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up environment (download dependencies) | |
| run: | | |
| brew install docker | |
| brew install kind | |
| brew install bats-core | |
| - name: Setup tmate session | |
| uses: mxschmitt/action-tmate@v3 | |
| - name: Bats tests | |
| env: | |
| TERM: linux # fix tput for tty issue work around | |
| run: | | |
| bash --version | |
| bash -c "time bats -o _artifacts --trace --formatter tap tests/" | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }} | |
| path: ./_artifacts | |