Skip to content
Permalink
Browse files

fully switch to GitHub Actions for CI

We were only using it now for fuzzit, but we've moved that to GitHub
Actions as well, setting up the required secret.

Also enable Windows on Actions, with a TODO to reenable the troublesome
test once they fix their %TEMP% bug.

Finally, update the fuzzit dependency, since it now knows to use Actions
env vars to fetch the git commit sha and branch.
  • Loading branch information...
mvdan committed Sep 8, 2019
1 parent 0a56b9a commit 473bddae0a422e8277adcd1315d3102961497072
Showing with 42 additions and 52 deletions.
  1. +2 −0 .gitattributes
  2. +25 −6 .github/workflows/test.yml
  3. +0 −26 .travis.yml
  4. +0 −1 README.md
  5. +1 −6 _fuzz/it/go.mod
  6. +6 −5 _fuzz/it/go.sum
  7. +0 −4 cmd/shfmt/main_test.go
  8. +8 −4 interp/interp_test.go
@@ -0,0 +1,2 @@
# To prevent CRLF breakages on Windows for fragile files, like testdata.
* -text
@@ -7,12 +7,9 @@ jobs:
strategy:
matrix:
# TODO: use .x once the setup-go action doesn't run into unauthenticated
# rate limites. See: https://github.com/actions/setup-go/issues/16
go-version: [1.11.9, 1.12.9]
# TODO: reenable windows once this issue is fixed:
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432
# platform: [ubuntu-latest, macos-latest, windows-latest]
platform: [ubuntu-latest, macos-latest]
# rate limits. See: https://github.com/actions/setup-go/issues/16
go-version: [1.12.9, 1.13]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
@@ -29,3 +26,25 @@ jobs:
run: go test -count=1 ./...
- name: Test with -short -race
run: go test -short -race -count=1 ./...

- name: gofmt check
run: diff <(echo -n) <(gofmt -d .)
if: matrix.platform == 'ubuntu-latest'

fuzz:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Checkout code
uses: actions/checkout@v1

- name: fuzz regression tests
run: cd _fuzz/it && ./fuzz-ci local-regression 2>&1 | grep -vE '^Running|^Executed'
- name: fuzz continuous job
run: export PATH="$PATH:$(go env GOPATH)/bin"; cd _fuzz/it && ./fuzz-ci fuzzing
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
FUZZIT_API_KEY: ${{ secrets.FUZZIT_API_KEY }}

This file was deleted.

@@ -1,7 +1,6 @@
# sh

[![GoDoc](https://godoc.org/mvdan.cc/sh?status.svg)](https://godoc.org/mvdan.cc/sh)
[![Build](https://travis-ci.org/mvdan/sh.svg?branch=master)](https://travis-ci.org/mvdan/sh)
[![fuzzit](https://app.fuzzit.dev/badge?org_id=mvdan)](https://fuzzit.dev)

A shell parser, formatter and interpreter. Supports [POSIX Shell], [Bash] and
@@ -5,14 +5,9 @@ go 1.13
replace mvdan.cc/sh/v3 => ./../..

require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/dvyukov/go-fuzz v0.0.0-20190808141544-193030f1cb16
github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect
github.com/frankban/quicktest v1.4.1 // indirect
github.com/fuzzitdev/fuzzit v1.2.8-0.20190819063729-75c132bbbc59
github.com/gorilla/mux v1.7.3 // indirect
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
github.com/fuzzitdev/fuzzit v1.2.8-0.20190908103145-1132165d521b
github.com/stephens2424/writerset v1.0.2 // indirect
gotest.tools v2.2.0+incompatible // indirect
mvdan.cc/sh/v3 v3.0.0-00010101000000-000000000000
)
@@ -59,12 +59,12 @@ github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg=
github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
github.com/frankban/quicktest v1.4.2 h1:eV8n2LQHuA97qKj0t6+7UrHRU0Smz9G+yh87F3Z+3Uk=
github.com/frankban/quicktest v1.4.2/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fuzzitdev/fuzzit v1.2.8-0.20190819063729-75c132bbbc59 h1:49aKEjf2x69Fi5Xn8DrDj0FLmbd7cBEhYERoLP7RxJA=
github.com/fuzzitdev/fuzzit v1.2.8-0.20190819063729-75c132bbbc59/go.mod h1:ENuwhEJ27yCxAX6R5YskKyRIddLrTGFHB5rhMvWEjZ4=
github.com/fuzzitdev/fuzzit v1.2.8-0.20190908103145-1132165d521b h1:3Mvi1pmvaoNWjMXpktyYQ3BxPigutHaozqnrMvGinVs=
github.com/fuzzitdev/fuzzit v1.2.8-0.20190908103145-1132165d521b/go.mod h1:SMRjzjaEujSkXqA9YYW8Yar6n3WhQ2fdj85TKCiL5gw=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
@@ -106,6 +106,8 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/h2non/filetype v1.0.10 h1:z+SJfnL6thYJ9kAST+6nPRXp1lMxnOVbMZHNYHMar0s=
github.com/h2non/filetype v1.0.10/go.mod h1:isekKqOuhMj+s/7r3rIeTErIRy4Rub5uBWHfvMusLMU=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -332,7 +334,6 @@ gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOA
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE=
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
@@ -10,7 +10,6 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"testing"

@@ -32,9 +31,6 @@ func TestMain(m *testing.M) {

func TestScripts(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" && (os.Getenv("TRAVIS") != "" || os.Getenv("GITHUB_WORKFLOW") != "") {
t.Skipf("skipping on CI under Windows due to CRLF issues")
}
testscript.Run(t, testscript.Params{
Dir: filepath.Join("testdata", "scripts"),
})
@@ -2111,10 +2111,6 @@ set +o pipefail
"mkdir -p x-d1/a x-d2/b; >x-f; echo x-*/* | sed 's@\\\\@/@g'",
"x-d1/a x-d2/b\n",
},
{
"mkdir x-d; >x-f; test -d $PWD/x-*/",
"",
},
{
"mkdir -p foo/bar; ln -s foo sym; echo sy*/; echo sym/b*",
"sym/\nsym/bar\n",
@@ -2417,6 +2413,14 @@ var runTestsUnix = []runTest{
"mkdir c; echo '#!/bin/sh\necho b' >c/a; chmod 0755 c/a; c/a",
"b\n",
},

// TODO: move back to the main tests list once
// https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427
// is fixed.
{
"mkdir x-d; >x-f; test -d $PWD/x-*/",
"",
},
}

var runTestsWindows = []runTest{

0 comments on commit 473bdda

Please sign in to comment.
You can’t perform that action at this time.