Skip to content

Commit

Permalink
New test action
Browse files Browse the repository at this point in the history
  • Loading branch information
danawoodman committed Feb 27, 2024
1 parent de2ac77 commit dfdacff
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Release Go Project
name: Release

on:
push:
Expand All @@ -24,15 +24,8 @@ jobs:
- name: Build for tests
run: make build

- name: Run unit tests
run: make test-unit

- name: Run e2e tests
run: |
pwd
ls -la
ls -la ..
make test-e2e
- name: Run tests
run: make test

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test

on: [push]

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "go.mod"

- name: Build for tests
run: make build

- name: Run tests
run: make test
5 changes: 1 addition & 4 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package test

import (
"bytes"
"fmt"
"io"
"os"
"os/exec"
Expand Down Expand Up @@ -73,16 +72,14 @@ func TestCng(t *testing.T) {
// todo: ignore files in node_modules / ,git by default
}

// Get the directory to the build binary
curDir := os.Getenv("GITHUB_WORKSPACE")
fmt.Println("github dir", curDir)
if curDir == "" {
wd, err := os.Getwd()
assert.NoError(t, err)
curDir = path.Join(wd, "..")
}
fmt.Println("curDir", curDir)
binDir := path.Join(curDir, "dist")
fmt.Println("binDir", binDir)

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down

0 comments on commit dfdacff

Please sign in to comment.