Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gh-actions): port circle config
- Loading branch information
Showing
3 changed files
with
164 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: "Paths: js/**" | ||
on: | ||
push: | ||
paths: | ||
- 'js/**' | ||
pull_request: | ||
paths: | ||
- 'js/**' | ||
|
||
jobs: | ||
js-generate: | ||
name: "Js: Check generation" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: bertytech/protoc:20 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
# TODO: cache | ||
- run: cd js && make gen.clean gen | ||
- run: | | ||
git status | cat | ||
git diff -w | cat | ||
git diff-index -w --quiet HEAD -- | ||
js-lint: | ||
name: "Js: Lint" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: bertytech/protoc:20 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
# TODO: cache | ||
- run: cd js && make lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
name: Main | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
go-docker: | ||
name: "Docker: Build berty/berty" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Build berty/berty | ||
uses: n0izn0iz/Publish-Docker-Github-Action@master | ||
with: | ||
name: berty/berty | ||
workdir: go | ||
|
||
go-generate: | ||
name: "Go: Check generation" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: bertytech/protoc:20 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- run: find . -name gen.sum -delete | ||
- run: cd go && go mod vendor | ||
- run: cd go && make generate_local && make tidy | ||
- run: cd docs && make generate_local | ||
- run: | | ||
git status | cat | ||
git diff -w | cat | ||
git diff-index -w --quiet HEAD -- | ||
githooks: | ||
name: "Githooks" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: bertytech/githooks:v1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- run: ./githooks/pre-commit | ||
- run: | | ||
git status | cat | ||
git diff -w | cat | ||
git diff-index -w --quiet HEAD -- | ||
go-build-112: | ||
name: "Go: Build" | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GO111MODULE: on | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.12.x | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
# TODO: cache $GOPATH/pkg/mod | ||
- run: go mod download | ||
working-directory: ./go | ||
|
||
# https://circleci.com/orbs/registry/orb/gotest/tools#commands-mod-tidy-check | ||
- run: go mod tidy -v | ||
working-directory: ./go | ||
- run: git --no-pager diff go.mod go.sum | ||
working-directory: ./go | ||
- run: git --no-pager diff --quiet go.mod go.sum | ||
working-directory: ./go | ||
|
||
- run: make go.install | ||
working-directory: ./go | ||
- run: make go.unittest GO_TEST_OPTS="-v -test.timeout=120s" | ||
working-directory: ./go | ||
- run: make tidy | ||
working-directory: ./go | ||
- name: Setup golangci-lint | ||
working-directory: ./go | ||
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0 | ||
- run: PATH=$PATH:$(pwd)/bin make lint | ||
working-directory: ./go | ||
- if: matrix.os == 'ubuntu-latest' | ||
uses: codecov/codecov-action@v1.0.3 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
file: ./go/coverage.txt | ||
|
||
bazel-go: | ||
name: "Go: Bazel" | ||
strategy: | ||
matrix: | ||
bazel-target: [unittest, banner, build] | ||
os: [macos-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- if: contains(matrix.os, 'macos-') | ||
name: Install bazel (darwin) | ||
working-directory: /tmp | ||
run: | | ||
curl -LO https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-installer-darwin-x86_64.sh | ||
chmod +x bazel-0.29.1-installer-darwin-x86_64.sh | ||
./bazel-0.29.1-installer-darwin-x86_64.sh --user | ||
- if: contains(matrix.os, 'ubuntu-') | ||
name: Install bazel (linux) | ||
working-directory: /tmp | ||
run: | | ||
curl -LO https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-installer-linux-x86_64.sh | ||
chmod +x bazel-0.29.1-installer-linux-x86_64.sh | ||
./bazel-0.29.1-installer-linux-x86_64.sh --user | ||
- name: Setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.12.x | ||
- name: Print versions | ||
run: | | ||
PATH=${PATH}:${HOME}/bin bazel --version | ||
go version | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Run make bazel.${{ matrix.bazel-target }} | ||
working-directory: ./go | ||
env: | ||
BAZEL_CMD_ARGS: --sandbox_debug --jobs=2 --local_ram_resources=HOST_RAM*.5 | ||
run: PATH=${PATH}:${HOME}/bin make bazel.${{ matrix.bazel-target }} |