Skip to content

Update README.md (#400) #461

Update README.md (#400)

Update README.md (#400) #461

Workflow file for this run

name: Run tests
on: push
jobs:
test:
name: Run tests
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
account_type:
- personal
- business
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.19"
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install \
gcc \
pkg-config \
libwebkit2gtk-4.0-dev \
libjson-glib-dev \
make \
wget \
rpm \
awscli \
libreoffice
sudo rm /usr/local/bin/aws # whyyy
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Check go formatting
run: |
go install golang.org/x/tools/cmd/goimports@latest
goimports -l .
- name: Copy auth tokens from S3
run: |
which aws
aws --version
aws s3 cp s3://fusefs-travis/$ACCOUNT_TYPE/.auth_tokens.json .
aws s3 cp s3://fusefs-travis/dmel.fa.gz .
gunzip dmel.fa.gz
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ACCOUNT_TYPE: ${{ matrix.account_type }}
- name: Run tests
run: |
go install github.com/rakyll/gotest@latest
# cannot run systemd tests here because github actions runners don't have dbus setup +
# if CGO is on, the UI tests will take foreverrrrr
bash cgo-helper.sh
CGO_ENABLED=0 gotest -v -tags=glib_2_64 -covermode=count -coverpkg=./ui/... -coverprofile=ui.coverage ./ui
gotest -v -tags=glib_2_64 -covermode=count -coverpkg=./cmd/common -coverprofile=common.coverage ./cmd/common
gotest -v -tags=glib_2_64 -covermode=count -coverpkg=./fs/... -coverprofile=quickxorhash.coverage ./fs/graph/quickxorhash
gotest -v -tags=glib_2_64 -covermode=count -coverpkg=./fs/... -coverprofile=graph.coverage ./fs/graph
gotest -v -tags=glib_2_64 -covermode=count -coverpkg=./fs/... -coverprofile=fs.coverage ./fs
go test -c -tags=glib_2_64 -covermode=count -coverpkg=./fs/... ./fs/offline
sudo unshare -n -S $(id -u) -G $(id -g) ./offline.test -test.v -test.coverprofile=offline.coverage
- name: Copy new auth tokens to S3
run: |
/usr/bin/aws s3 cp .auth_tokens.json s3://fusefs-travis/$ACCOUNT_TYPE/
/usr/bin/aws s3 cp fusefs_tests.log s3://fusefs-travis/$ACCOUNT_TYPE/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ACCOUNT_TYPE: ${{ matrix.account_type }}
if: always()
- name: Combine test coverage into single file
run: |
go install github.com/wadey/gocovmerge@latest
gocovmerge *.coverage > coverage.out
if: always()
- name: Convert coverage to lcov
uses: jandelgado/[email protected]
if: always()
- name: Send test coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
flag-name: ${{ matrix.account_type }}
parallel: true
# decreased coverage isn't a failure
continue-on-error: true
if: always()
finish:
name: Complete Coveralls run
needs: test
if: always()
runs-on: ubuntu-20.04
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
# decreased coverage isn't a failure
continue-on-error: true