2021-03-29 23:17:19 +00:00
|
|
|
name: Continuous integration
|
|
|
|
on: [ push ]
|
|
|
|
jobs:
|
2021-03-30 16:16:07 +00:00
|
|
|
tests:
|
2021-03-29 23:17:19 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-04-02 12:47:09 +00:00
|
|
|
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
2021-03-29 23:17:19 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.16.x
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
|
|
|
sudo apt update && sudo apt install build-essential
|
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}
|
2021-04-02 12:47:09 +00:00
|
|
|
- name: Build (non-windows)
|
|
|
|
if: matrix.os != 'windows-latest'
|
2021-03-29 23:17:19 +00:00
|
|
|
run: make all
|
2021-04-02 12:47:09 +00:00
|
|
|
- name: Build (windows)
|
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
run: |
|
|
|
|
go build -trimpath -o bin/tg.exe ./cmd/tg
|
|
|
|
go build -trimpath -o bin/rpcdaemon.exe ./cmd/rpcdaemon
|
|
|
|
go build -trimpath -o bin/rpctest.exe ./cmd/rpctest
|
|
|
|
go build -trimpath -o bin/integration.exe ./cmd/integration
|
|
|
|
go build -trimpath -o bin/headers.ext ./cmd/headers
|
2021-03-29 23:17:19 +00:00
|
|
|
- name: Lint
|
2021-04-15 08:28:16 +00:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2021-03-29 23:17:19 +00:00
|
|
|
uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
2021-04-08 03:47:10 +00:00
|
|
|
version: v1.38
|
2021-04-26 12:39:34 +00:00
|
|
|
args: "--build-tags=mdbx"
|
2021-03-29 23:17:19 +00:00
|
|
|
skip-go-installation: true
|
|
|
|
skip-pkg-cache: true
|
|
|
|
skip-build-cache: true
|
2021-04-02 12:47:09 +00:00
|
|
|
- name: Test (non-windows)
|
|
|
|
if: matrix.os != 'windows-latest'
|
2021-03-29 23:17:19 +00:00
|
|
|
run: make test
|
2021-03-30 16:16:07 +00:00
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- name: Docker
|
|
|
|
run: docker build .
|