Skip to content

Commit

Permalink
Merge pull request #32 from carsonreinke/add-missing-linux-binary-to-…
Browse files Browse the repository at this point in the history
…workflow

Add missing linux binary to workflow and fix testing
  • Loading branch information
SijmenHuizenga authored Mar 20, 2023
2 parents 93c6178 + dc93d00 commit 1339978
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.15

- name: Test
run: go test -v ./...
run: go test -v ./downloader # There is only a test in this folder

- name: Build
if: success()
run: |
GOOS=windows go build -ldflags "-s -w"
GOOS=darwin go build -o gitmoo-goog-osx -ldflags "-s -w"
go build -ldflags "-s -w"
go build -ldflags "-s -w" -o gitmoo-goog
cd installer
go build
./installer
cd ..
zip gitmoo-goog.zip installer/*.deb gitmoo-goog-osx gitmoo-goog.exe
zip gitmoo-goog.zip installer/*.deb gitmoo-goog gitmoo-goog-osx gitmoo-goog.exe
- name: Create Release
id: create_release
Expand Down
5 changes: 4 additions & 1 deletion downloader/downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package downloader
import (
"encoding/json"
"io/ioutil"
"mime"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -124,7 +125,9 @@ func TestCreateFileName(t *testing.T) {
item.MediaMetadata.CreationTime = "2019-10-13T17:33:43Z"

have := downloader.createFileName(item, 0)
want := "13_34567890.jpe"
// Extensions can vary by system and will just defer to that for the correct extension
ext, _ := mime.ExtensionsByType(item.MimeType)
want := "13_34567890" + ext[0]

if have != want {
t.Errorf("downloader.createFileName() = %v; want %v", have, want)
Expand Down

0 comments on commit 1339978

Please sign in to comment.