2
0
mirror of synced 2025-02-22 21:58:24 +00:00

Create go.yml (#497)

* 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
This commit is contained in:
Matt Joiner 2021-06-07 12:44:51 +10:00 committed by GitHub
parent 8f6f47a2e0
commit 125d7f0e90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 2 deletions

46
.github/workflows/go.yml vendored Normal file
View File

@ -0,0 +1,46 @@
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

View File

@ -1,7 +1,7 @@
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
@ -11,7 +11,7 @@ popd
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" $?