* Create go.yml
* Go version 1.16
* Add benchmarks
* Match CircleCI test coverage
* Add 15 minute timeout
* Don't log to file
* Download modules in separate step, minimize test runs
* Install godo before running torrentfs end-to-end test
* More fixes
* More fixes for GitHub Actions CI
--- /dev/null
+name: Go
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+
+ build:
+ timeout-minutes: 30
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Go
+ uses: actions/setup-go@v2
+ with:
+ go-version: 1.16
+
+ - name: Download Go modules
+ run: go mod download
+
+ - name: Build
+ run: go build ./...
+
+ - name: Test
+ run: go test -race ./...
+
+ - name: Bench
+ run: go test -run @ -bench . ./...
+
+ - name: Test on 386
+ run: GOARCH=386 go test ./... -bench .
+ continue-on-error: true
+
+ - name: Install godo
+ run: go install github.com/anacrolix/godo@latest
+
+ - name: Apt packages
+ run: sudo apt install pv fuse
+
+ - name: torrentfs end-to-end test
+ run: fs/test.sh
+ timeout-minutes: 10
set -eux
repopath="$(cd "$(dirname "$0")/.."; pwd)"
mkdir -p mnt torrents
-GOPPROF=http godo -v "$repopath/cmd/torrentfs" -mountDir=mnt -metainfoDir=torrents &> log &
+GOPPROF=http godo -v "$repopath/cmd/torrentfs" -mountDir=mnt -metainfoDir=torrents &
trap 'set +e; sudo umount -f mnt' EXIT
debian_file=debian-10.8.0-amd64-netinst.iso
pushd torrents
file="$debian_file"
# file=sintel.mp4
while [ ! -e "mnt/$file" ]; do sleep 1; done
-pv "mnt/$file" | md5sum
+pv -f "mnt/$file" | md5sum
# expect e221f43f4fdd409250908fc4305727d4
sudo umount mnt
wait || echo "wait returned" $?