added github workflow
This commit is contained in:
59
.github/workflows/build.yml
vendored
Normal file
59
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.24.3'
|
||||
|
||||
- name: Install Fyne dependencies
|
||||
run: |
|
||||
# Install required system dependencies for Fyne
|
||||
brew install pkg-config
|
||||
|
||||
- name: Install Fyne CLI
|
||||
run: go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||
|
||||
- name: Cache Go modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Verify dependencies
|
||||
run: go mod verify
|
||||
|
||||
- name: Run tests
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Build application
|
||||
run: make build
|
||||
|
||||
- name: Verify build output
|
||||
run: |
|
||||
ls -la TurtleSilicon.app/
|
||||
ls -la TurtleSilicon.app/Contents/Resources/
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: TurtleSilicon-macos
|
||||
path: TurtleSilicon.app/
|
||||
retention-days: 30
|
@@ -1,5 +1,7 @@
|
||||
# TurtleSilicon <img src="Icon.png" alt="TurtleSilicon Logo" width="50" height="50" align="center">
|
||||
|
||||
[](https://github.com/tairasu/TurtleSilicon/actions/workflows/build.yml)
|
||||
|
||||
<div align="center">
|
||||
<img src="img/turtlesilicon-fps_v2.png" alt="Turtle WoW FPS on Apple Silicon" width="49%" />
|
||||
<img src="img/turtlesilicon-app_v3.png" alt="TurtleSilicon Application" width="49%" />
|
||||
|
10
main_test.go
Normal file
10
main_test.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMain(t *testing.T) {
|
||||
// Basic test to ensure the main package can be imported and tested
|
||||
t.Log("TurtleSilicon main package test passed")
|
||||
}
|
25
pkg/utils/utils_test.go
Normal file
25
pkg/utils/utils_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPathExists(t *testing.T) {
|
||||
// Test with a path that should exist (current directory)
|
||||
currentDir, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to get current directory: %v", err)
|
||||
}
|
||||
|
||||
if !PathExists(currentDir) {
|
||||
t.Errorf("PathExists(%s) = false, want true", currentDir)
|
||||
}
|
||||
|
||||
// Test with a path that should not exist
|
||||
nonExistentPath := filepath.Join(currentDir, "this-path-should-not-exist-12345")
|
||||
if PathExists(nonExistentPath) {
|
||||
t.Errorf("PathExists(%s) = true, want false", nonExistentPath)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user