diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 08b257a..1931b48 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -4,7 +4,13 @@ on: branches: [ main ] pull_request: branches: [ main ] + workflow_dispatch: jobs: + info: + runs-on: ubuntu-latest + steps: + - name: Show GitHub context + run: echo "${{ toJson(github) }}" tests: runs-on: ubuntu-latest steps: @@ -16,4 +22,20 @@ jobs: - name: Run tests run: go test -v ./... + + + build: + runs-on: ubuntu-latest + needs: tests + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: '1.25.4' + - name: Build the application + run: go build -v ./... + + + diff --git a/mathops.go b/mathops.go index d9d42fc..b491158 100644 --- a/mathops.go +++ b/mathops.go @@ -1,5 +1,9 @@ package main +func main() { + // Example usage of the functions + println(Add(5, 3)) // Output: 8 +} // Add returns the sum of two integers. func Add(a, b int) int { return a + b diff --git a/mathops_test.go b/mathops_test.go index a27c705..d35a941 100644 --- a/mathops_test.go +++ b/mathops_test.go @@ -73,7 +73,7 @@ func TestDisplayName(t *testing.T) { input string want string }{ - {name: "regular name", input: "Alice", want: "Hello, Alices!"}, + {name: "regular name", input: "Alice", want: "Hello, Alice!"}, {name: "empty name", input: "", want: "Hello, !"}, }