Updated openSUSE Leap installation instructions. (#377) #447
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: "1.17" | |
- 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@v2 | |
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 -covermode=count -coverpkg=./ui/... -coverprofile=ui.coverage ./ui | |
gotest -v -covermode=count -coverpkg=./cmd/common -coverprofile=common.coverage ./cmd/common | |
gotest -v -covermode=count -coverpkg=./fs/... -coverprofile=quickxorhash.coverage ./fs/graph/quickxorhash | |
gotest -v -covermode=count -coverpkg=./fs/... -coverprofile=graph.coverage ./fs/graph | |
gotest -v -covermode=count -coverpkg=./fs/... -coverprofile=fs.coverage ./fs | |
go test -c -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/[email protected] | |
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/[email protected] | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true | |
# decreased coverage isn't a failure | |
continue-on-error: true |