Skip to content

Commit

Permalink
Refactors release end-to-end tests to include Windows (#330)
Browse files Browse the repository at this point in the history
Before, we didn't test Windows. This adds tests and also makes updating
the homebrew formula depend on e2e succeeding.

Moreover, this removes a shell script in favor of `gh` commands which
are included in the default images.

See https://github.com/actions/virtual-environments/blob/main/images

Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
codefromthecrypt authored Aug 6, 2021
1 parent 8f08765 commit cca6166
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 34 deletions.
29 changes: 0 additions & 29 deletions .github/untar_func-e_release.sh

This file was deleted.

27 changes: 22 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,25 @@ jobs:
run: make release

e2e:
needs: func-e
name: Run e2e tests (${{ matrix.os }})
needs:
- func-e
runs-on: ${{ matrix.os }}
timeout-minutes: 90 # instead of 360 by default
strategy:
fail-fast: false # don't fail fast as sometimes failures are operating system specific
matrix:
os: [ ubuntu-latest, macos-latest ]
include:
- os: ubuntu-latest
pattern: '*linux_amd64.tar.gz'
- os: macos-latest
pattern: '*darwin_amd64.tar.gz'
- os: windows-latest
pattern: '*windows_amd64.zip'
unzip: unzip -o *.zip && rm *.zip

defaults:
run: # use bash for all operating systems unless overridden
shell: bash

steps:
- name: "Checkout"
uses: actions/checkout@v2
Expand All @@ -51,13 +61,20 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: "Extract `func-e` binary from GitHub release assets"
run: .github/untar_func-e_release.sh ${GITHUB_REF#refs/*/}
run: |
gh release download "${GITHUB_REF#refs/tags/}" -p '${{ matrix.pattern }}'
${{ matrix.unzip || tar -xzf *.tar.gz && rm *.tar.gz }}
env: # authenticate as the release is a draft
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Run e2e tests using released `func-e` binary"
run: go test -parallel 1 -v -failfast ./e2e

homebrew:
needs: e2e
name: Bump homebrew-core formula
runs-on: ubuntu-latest
steps:
- name: Bump homebrew-core formula
uses: mislav/bump-homebrew-formula-action@v1
with:
Expand Down
1 change: 1 addition & 0 deletions internal/moreos/moreos.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

const (
// Exe is the runtime.GOOS-specific suffix for executables. Ex. "" unless windows which is ".exe"
// See https://github.com/golang/go/issues/47567 for formalization
Exe = exe
// OSDarwin is a Platform.OS a.k.a. "macOS"
OSDarwin = "darwin"
Expand Down

0 comments on commit cca6166

Please sign in to comment.