commit
3ae35c5ce1
3 changed files with 14 additions and 10 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -19,6 +19,16 @@ jobs:
|
||||||
- name: Check format
|
- name: Check format
|
||||||
run: nix-shell --run 'nixpkgs-fmt --check .'
|
run: nix-shell --run 'nixpkgs-fmt --check .'
|
||||||
|
|
||||||
|
golangci-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
|
||||||
|
steps:
|
||||||
|
- uses: cachix/install-nix-action@v12
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Check format
|
||||||
|
run: nix-shell --run 'golangci-lint run'
|
||||||
|
|
||||||
gomod2nix_toml:
|
gomod2nix_toml:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -22,5 +22,6 @@ pkgs.mkShell {
|
||||||
pkgs.nixpkgs-fmt
|
pkgs.nixpkgs-fmt
|
||||||
pkgs.gomod2nix.go
|
pkgs.gomod2nix.go
|
||||||
pkgs.gomod2nix
|
pkgs.gomod2nix
|
||||||
|
pkgs.golangci-lint
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
13
tests/run.go
13
tests/run.go
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
@ -14,14 +13,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
type testError struct {
|
|
||||||
testDir string
|
|
||||||
stdout bytes.Buffer
|
|
||||||
stderr bytes.Buffer
|
|
||||||
}
|
|
||||||
|
|
||||||
func runProcess(prefix string, command string, args ...string) error {
|
func runProcess(prefix string, command string, args ...string) error {
|
||||||
fmt.Println(fmt.Sprintf("%s: Executing %s %s", prefix, command, args))
|
fmt.Printf("%s: Executing %s %s\n", prefix, command, args)
|
||||||
|
|
||||||
cmd := exec.Command(command, args...)
|
cmd := exec.Command(command, args...)
|
||||||
|
|
||||||
|
@ -42,7 +35,7 @@ func runProcess(prefix string, command string, args ...string) error {
|
||||||
scanner := bufio.NewScanner(reader)
|
scanner := bufio.NewScanner(reader)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Bytes()
|
line := scanner.Bytes()
|
||||||
fmt.Println(fmt.Sprintf("%s: %s", prefix, line))
|
fmt.Printf("%s: %s\n", prefix, line)
|
||||||
}
|
}
|
||||||
done <- struct{}{}
|
done <- struct{}{}
|
||||||
}()
|
}()
|
||||||
|
@ -118,7 +111,7 @@ func runTests(rootDir string, testDirs []string) error {
|
||||||
cmdErrChan := make(chan error)
|
cmdErrChan := make(chan error)
|
||||||
for _, testDir := range testDirs {
|
for _, testDir := range testDirs {
|
||||||
testDir := testDir
|
testDir := testDir
|
||||||
fmt.Println(fmt.Sprintf("Running test for: '%s'", testDir))
|
fmt.Printf("Running test for: '%s'\n", testDir)
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
Loading…
Reference in a new issue