diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d25367..9dd5c79 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,10 +13,11 @@ env: GOPROXY: direct jobs: - tests: + # Breaking tests into 2 phases, to prevent account lock out due to DOS protection + tests-1: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Set up Go @@ -25,7 +26,41 @@ jobs: go-version: 1.21.4 - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Run Golang Tests + run: go test -v ./... + + - name: Setup BATS + if: runner.os != 'windows' + run: | + set -e + + if [ -n "$GITHUB_RUN_ID" ]; then + export GITHUB_API_TOKEN="${{ secrets.GITHUB_TOKEN }}" + fi + + git clone https://github.com/bats-core/bats-core.git && bats-core/install.sh $HOME + + - name: Run BATS Tests + if: runner.os != 'windows' + run: | + export PATH=${PATH}:/home/runner/bin + # Retry hack to attempt test 3 times + bats test/bats + tests-2: + strategy: + matrix: + os: [macos-14, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.21.4 + + - name: Checkout Code + uses: actions/checkout@v4 - name: Run Golang Tests run: go test -v ./...