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:
parent
8f6f47a2e0
commit
125d7f0e90
46
.github/workflows/go.yml
vendored
Normal file
46
.github/workflows/go.yml
vendored
Normal 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
|
@ -1,7 +1,7 @@
|
|||||||
set -eux
|
set -eux
|
||||||
repopath="$(cd "$(dirname "$0")/.."; pwd)"
|
repopath="$(cd "$(dirname "$0")/.."; pwd)"
|
||||||
mkdir -p mnt torrents
|
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
|
trap 'set +e; sudo umount -f mnt' EXIT
|
||||||
debian_file=debian-10.8.0-amd64-netinst.iso
|
debian_file=debian-10.8.0-amd64-netinst.iso
|
||||||
pushd torrents
|
pushd torrents
|
||||||
@ -11,7 +11,7 @@ popd
|
|||||||
file="$debian_file"
|
file="$debian_file"
|
||||||
# file=sintel.mp4
|
# file=sintel.mp4
|
||||||
while [ ! -e "mnt/$file" ]; do sleep 1; done
|
while [ ! -e "mnt/$file" ]; do sleep 1; done
|
||||||
pv "mnt/$file" | md5sum
|
pv -f "mnt/$file" | md5sum
|
||||||
# expect e221f43f4fdd409250908fc4305727d4
|
# expect e221f43f4fdd409250908fc4305727d4
|
||||||
sudo umount mnt
|
sudo umount mnt
|
||||||
wait || echo "wait returned" $?
|
wait || echo "wait returned" $?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user