c08bf86b71
Updates #2275. Squashed commit of the following: commit f24c26cd2b49fac00a581936da4ccb13ca341bc9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 21:33:15 2021 +0300 aghtest: imp docs commit 46f5b06f9743e800b489e8c30af07d24bfdcf989 Merge: bfb852cb55d4c7ee
Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 21:32:32 2021 +0300 Merge branch 'master' into 2275-upd commit bfb852cbc74ec219a41e985f2dcb090d58299aee Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 19:06:32 2021 +0300 scripts: rem unsupported platform commit c1645e247f18d384a980c60d3a94b9363f83f174 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:47:57 2021 +0300 all: rollback more commit 989811b5e38498234dc11baf5dd153c76b9dada4 Merge: 976bdfbd2d704242
Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:30:42 2021 +0300 Merge branch 'master' into 2275-upd commit 976bdfbdd44983f4cd657a486b94ff63f5885fd5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:28:23 2021 +0300 aghtest: fix os_windows commit 9e85080eefe882d72c939969f7008e3c46467c0c Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:15:37 2021 +0300 all: rewrite windows workaround, imp code, docs commit 35a0b1d8656640a962fe9ae019c3d665f42707ce Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jan 21 20:38:17 2021 +0300 all: update go and backend tools
140 lines
4.6 KiB
YAML
140 lines
4.6 KiB
YAML
'name': 'build'
|
|
|
|
'env':
|
|
'GO_VERSION': '1.15'
|
|
'NODE_VERSION': '14'
|
|
|
|
'on':
|
|
'push':
|
|
'branches':
|
|
- '*'
|
|
'tags':
|
|
- 'v*'
|
|
'pull_request':
|
|
|
|
'jobs':
|
|
'test':
|
|
'runs-on': '${{ matrix.os }}'
|
|
'env':
|
|
'GO111MODULE': 'on'
|
|
'GOPROXY': 'https://goproxy.io'
|
|
'strategy':
|
|
'fail-fast': false
|
|
'matrix':
|
|
'os':
|
|
- 'ubuntu-latest'
|
|
- 'macOS-latest'
|
|
- 'windows-latest'
|
|
'steps':
|
|
- 'name': 'Checkout'
|
|
'uses': 'actions/checkout@v2'
|
|
'with':
|
|
'fetch-depth': 0
|
|
- 'name': 'Set up Go'
|
|
'uses': 'actions/setup-go@v2'
|
|
'with':
|
|
'go-version': '${{ env.GO_VERSION }}'
|
|
- 'name': 'Set up Node'
|
|
'uses': 'actions/setup-node@v1'
|
|
'with':
|
|
'node-version': '${{ env.NODE_VERSION }}'
|
|
- 'name': 'Set up Go modules cache'
|
|
# TODO(a.garipov): Update when they fix the macOS issue. The issue is
|
|
# most probably https://github.com/actions/cache/issues/527.
|
|
'uses': 'actions/cache@v2.1.3'
|
|
'with':
|
|
'path': '~/go/pkg/mod'
|
|
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
|
|
'restore-keys': '${{ runner.os }}-go-'
|
|
- 'name': 'Get npm cache directory'
|
|
'id': 'npm-cache'
|
|
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
|
|
- 'name': 'Set up npm cache'
|
|
# TODO(a.garipov): Update when they fix the macOS issue. The issue is
|
|
# most probably https://github.com/actions/cache/issues/527.
|
|
'uses': 'actions/cache@v2.1.3'
|
|
'with':
|
|
'path': '${{ steps.npm-cache.outputs.dir }}'
|
|
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
|
|
'restore-keys': '${{ runner.os }}-node-'
|
|
- 'name': 'Run make ci'
|
|
'shell': 'bash'
|
|
'run': 'make VERBOSE=1 ci'
|
|
- 'name': 'Upload coverage'
|
|
'uses': 'codecov/codecov-action@v1'
|
|
'if': "success() && matrix.os == 'ubuntu-latest'"
|
|
'with':
|
|
'token': '${{ secrets.CODECOV_TOKEN }}'
|
|
'file': './coverage.txt'
|
|
'build-release':
|
|
'runs-on': 'ubuntu-latest'
|
|
'needs': 'test'
|
|
'steps':
|
|
- 'name': 'Checkout'
|
|
'uses': 'actions/checkout@v2'
|
|
'with':
|
|
'fetch-depth': 0
|
|
- 'name': 'Set up Go'
|
|
'uses': 'actions/setup-go@v2'
|
|
'with':
|
|
'go-version': '${{ env.GO_VERSION }}'
|
|
- 'name': 'Set up Node'
|
|
'uses': 'actions/setup-node@v1'
|
|
'with':
|
|
'node-version': '${{ env.NODE_VERSION }}'
|
|
- 'name': 'Set up Go modules cache'
|
|
# TODO(a.garipov): Update when they fix the macOS issue. The issue is
|
|
# most probably https://github.com/actions/cache/issues/527.
|
|
'uses': 'actions/cache@v2.1.3'
|
|
'with':
|
|
'path': '~/go/pkg/mod'
|
|
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
|
|
'restore-keys': '${{ runner.os }}-go-'
|
|
- 'name': 'Get npm cache directory'
|
|
'id': 'npm-cache'
|
|
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
|
|
- 'name': 'Set up npm cache'
|
|
# TODO(a.garipov): Update when they fix the macOS issue. The issue is
|
|
# most probably https://github.com/actions/cache/issues/527.
|
|
'uses': 'actions/cache@v2.1.3'
|
|
'with':
|
|
'path': '${{ steps.npm-cache.outputs.dir }}'
|
|
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
|
|
'restore-keys': '${{ runner.os }}-node-'
|
|
- 'name': 'Set up Snapcraft'
|
|
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
|
|
- 'name': 'Set up QEMU'
|
|
'uses': 'docker/setup-qemu-action@v1'
|
|
- 'name': 'Set up Docker Buildx'
|
|
'uses': 'docker/setup-buildx-action@v1'
|
|
- 'name': 'Run snapshot build'
|
|
'run': 'make SIGN=0 VERBOSE=1 build-release build-docker'
|
|
|
|
'notify':
|
|
'needs':
|
|
- 'build-release'
|
|
# Secrets are not passed to workflows that are triggered by a pull request
|
|
# from a fork.
|
|
#
|
|
# Use always() to signal to the runner that this job must run even if the
|
|
# previous ones failed.
|
|
'if':
|
|
${{ always() &&
|
|
(
|
|
github.event_name == 'push' ||
|
|
github.event.pull_request.head.repo.full_name == github.repository
|
|
)
|
|
}}
|
|
'runs-on': 'ubuntu-latest'
|
|
'steps':
|
|
- 'name': 'Conclusion'
|
|
'uses': 'technote-space/workflow-conclusion-action@v1'
|
|
- 'name': 'Send Slack notif'
|
|
'uses': '8398a7/action-slack@v3'
|
|
'with':
|
|
'status': '${{ env.WORKFLOW_CONCLUSION }}'
|
|
'fields': 'repo, message, commit, author, workflow'
|
|
'env':
|
|
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
|
|
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}'
|