Skip to content

add bats tests and fix udp on mac and windows #6

add bats tests and fix udp on mac and windows

add bats tests and fix udp on mac and windows #6

Workflow file for this run

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@v2
- 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@v2
- name: Setup Bats and bats libs
id: setup-bats
uses: bats-core/bats-action@3.0.0
- name: Set up environment (download dependencies)
run: |
# For Intel Macs
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-darwin-amd64
# For M1 / ARM Macs
[ $(uname -m) = arm64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-darwin-arm64
chmod +x ./kind
mv ./kind /usr/local/bin/kind
brew install docker
colima start
- 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