Skip to content

Commit

Permalink
Workflow updated
Browse files Browse the repository at this point in the history
Tests are now also executed under Windows and Linux.
  • Loading branch information
vorlif committed May 23, 2022
1 parent af3a62a commit 83cde83
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 37 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/build.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test

on:
push:
pull_request:

jobs:

golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'
- uses: actions/checkout@v3
- name: lint
uses: golangci/[email protected]
with:
version: latest

test:
strategy:
matrix:
platform:
- ubuntu
- macOS
- windows
go:
- 18
name: '${{ matrix.platform }} | 1.${{ matrix.go }}.x'
runs-on: ${{ matrix.platform }}-latest
steps:

- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: 1.${{ matrix.go }}.x

- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-1.${{ matrix.go }}.x-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-1.${{ matrix.go }}.x-

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

- name: Test
run: go test -v ./...
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewDefault() *Config {
return &Config{
IsVerbose: false,
SourceDir: "",
OutputDir: "./",
OutputDir: filepath.Clean("./"),
OutputFile: "",
CommentPrefixes: []string{"TRANSLATORS"},
ExtractErrors: false,
Expand Down
7 changes: 4 additions & 3 deletions tmplextractors/testlib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tmplextractors

import (
"context"
"path/filepath"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -12,9 +13,9 @@ import (
"github.com/vorlif/xspreak/result"
)

const (
testdataDir = "../testdata/project"
testdataTemplates = "../testdata/tmpl"
var (
testdataDir = filepath.FromSlash("../testdata/project")
testdataTemplates = filepath.FromSlash("../testdata/tmpl")
)

func runExtraction(t *testing.T, dir string, testExtractors ...extractors.Extractor) []result.Issue {
Expand Down

0 comments on commit 83cde83

Please sign in to comment.