You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.8 KiB
YAML

name: CI
on:
push:
branches: [master, develop]
pull_request:
branches: [master]
jobs:
Go:
name: Go
runs-on: ubuntu-latest
env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto
strategy:
matrix:
go: [ '1.16.x', '1.17.x' ]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
id: go
- name: Setup PATH
run: |
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{env.SRC_DIR}}
- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
run: make deps deps-test
- name: Download Verdana font
working-directory: ${{env.SRC_DIR}}
run: curl -L -o 'Verdana.ttf' 'https://github.com/matomo-org/travis-scripts/raw/master/fonts/Verdana.ttf'
- name: Run tests
working-directory: ${{env.SRC_DIR}}
run: go test -v -covermode count -coverprofile cover.out ./...
- name: Install goveralls
env:
GO111MODULE: off
run: go get -v github.com/mattn/goveralls
- name: Send coverage to Coveralls
working-directory: ${{env.SRC_DIR}}
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -service github -coverprofile cover.out
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install codeclimate-test-reporter
run: npm install -g codeclimate-test-reporter
- name: Send coverage to Codebeat
working-directory: ${{env.SRC_DIR}}
env:
CODECLIMATE_API_HOST: https://codebeat.co/webhooks/code_coverage
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
run: codeclimate-test-reporter < cover.out
Aligo:
name: Aligo
runs-on: ubuntu-latest
needs: Go
env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.16.x'
id: go
- name: Setup PATH
run: |
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{env.SRC_DIR}}
- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
run: make deps
- name: Check Golang sources with Aligo
uses: essentialkaos/aligo-action@v1
with:
path: ${{env.SRC_DIR}}
files: ./...