Skip to content

Commit

Permalink
Add smoke tests in CI (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
timsutton committed Sep 19, 2023
1 parent 3ce1631 commit 4fdd006
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go
name: CI

on:
push:
Expand All @@ -11,24 +11,24 @@ on:

jobs:

build:
runs-on: ubuntu-latest
smoke-test:
strategy:
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'

- name: Build
run: go build -v ./...
# - name: Build
# run: go build -v

- name: Test
run: go test -v ./...
# - name: Test
# run: go test -v ./...

- name: Smoke Test
run: |
./speedwagon list
# smallest 'package' type
./speedwagon download 'tvOS 12.4 Simulator'
run: bash script/smoke_test.sh
33 changes: 33 additions & 0 deletions script/smoke_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -eux

function cleanup() {
rm -f tvOS* com.apple.pkg*
}

trap cleanup EXIT

function build() {
go build -v
}

function test() {
./speedwagon list

(
version=$(./speedwagon version)
grep -q $version util/version.go
)

# # smallest 'package' type
./speedwagon download 'tvOS 12.4 Simulator'
file com.apple.pkg.AppleTVSimulatorSDK12_4*.dmg | grep -q 'zlib compressed data'

# # smallest 'diskImage' type
./speedwagon download 'tvOS 16 Simulator Runtime'
file tvOS_16_Simulator_Runtime.dmg | grep -q 'lzfse encoded, lzvn compressed'
}

build
test

0 comments on commit 4fdd006

Please sign in to comment.