-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github actions #1467
Merged
Merged
Github actions #1467
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d73da60
migrate lint and unit tests
vedhavyas f4c69f4
update workflow
vedhavyas b579a7f
seperate workflows and install subkey
vedhavyas d2c961b
fix env ref
vedhavyas 53a2a3c
migrate cmd tests
vedhavyas 1f9db2b
use matrix
vedhavyas 5f955cf
use matrix
vedhavyas dbdb732
migrate integration tests
vedhavyas d3dc751
migrate testworld
vedhavyas 99acd5a
ensure pullrequest and push wont trigger multiple times
vedhavyas 76e6b85
use explicit ubuntu version
vedhavyas 8dc0b8f
add debug line
vedhavyas 277bc6a
enable logging
vedhavyas f0101a3
upgrade gocelery
vedhavyas 35fb4d6
rewrite notifications tests
vedhavyas 1c529d1
set debug writer
vedhavyas d3a90bf
add caching
vedhavyas f147171
use compact printer
vedhavyas 43a4a03
ensure distinct cache keys
vedhavyas 4928ec6
faster unit tests?
vedhavyas 4f754db
more cache optimisations
vedhavyas 14f96e8
rename to checks
vedhavyas a799313
test build
vedhavyas bcafc2c
revert build workflow tests
vedhavyas b9ac9c3
update build flow with docker details
vedhavyas 570481b
remove travis.yml and xgo
vedhavyas ac97674
add more os
vedhavyas 45ecad3
not ready for windows test runner yet
vedhavyas 7f60aa6
accomodate nix installation for darwin
vedhavyas b9d4752
remove mac as well
vedhavyas 8bb619c
add release
vedhavyas ce5182f
update release
vedhavyas 7e200bf
build with tag
vedhavyas 1341308
on release
vedhavyas f964809
add stack.go to uncovered
vedhavyas a3be669
use a different releaser
vedhavyas 9a6c31c
minor changes
vedhavyas adee027
use github sha
vedhavyas c811a39
release changes
vedhavyas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# build workflow builds docker images, pushes images to docker hub and updates swagger API | ||
on: | ||
push: | ||
branches: [develop, master] | ||
name: Build | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
SWAGGER_API_KEY: ${{ secrets.swagger_api_key }} | ||
DOCKER_USERNAME: ${{ secrets.docker_username }} | ||
DOCKER_PASSWORD: ${{ secrets.docker_password }} | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/pkg/mod | ||
key: ${{ runner.os }}-go-${{ github.job }} | ||
- name: Build docker images | ||
run: make build-docker | ||
- name: Push images to Docker Hub | ||
run: make push-to-docker | ||
- name: Push API to swagger | ||
run: make push-to-swagger |
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,39 @@ | ||
# lint workflow runs golangci-lint, re generate swagger api and checks for any diffs | ||
on: | ||
push: | ||
branches: [develop, master] | ||
pull_request: | ||
name: Checks | ||
jobs: | ||
lint: | ||
name: lint check | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/pkg/mod | ||
key: ${{ runner.os }}-go-${{ github.job }} | ||
- name: Install dependencies | ||
run: | | ||
make install-deps | ||
- name: Lint check | ||
run: | | ||
make lint-check gen-swagger | ||
echo "Checking that swagger gen didn't result in a modified git tree" && git diff --exit-code ./http |
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,83 @@ | ||
# release workflow gets triggered when a tag is pushed | ||
# build job builds artifacts on different os and uploads them to a temporary location | ||
# release job pulls the artifacts down, creates a changelog and creates a new draft release | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
name: Release | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
os: [ubuntu-latest, macos-latest] | ||
arch: [amd64] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/pkg/mod | ||
key: ${{ runner.os }}-go-${{ github.job }}-${{ matrix.arch }} | ||
- name: Build ${{ matrix.os }}-${{ matrix.arch }} binary | ||
run: arch=${{ matrix.arch }} make build-binary | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ github.sha }}-artifacts | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/*.tar.gz | ||
if-no-files-found: error | ||
release: | ||
needs: build | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
fetch-depth: 0 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ github.sha }}-artifacts | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
- name: Downloaded artifacts | ||
run: ls -R *.tar.gz | ||
- name: Generate changelog | ||
id: changelog | ||
uses: heinrichreimer/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
onlyLastTag: "true" | ||
stripHeaders: "true" | ||
stripGeneratorNotice: "true" | ||
output: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/CHANGELOG.md | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/CHANGELOG.md | ||
files: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/*.tar.gz | ||
draft: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,57 @@ | ||
# test works flow run unit, cmd, integration and testworld tests parallely in 4 jobs | ||
on: | ||
push: | ||
branches: [develop, master] | ||
pull_request: | ||
name: Tests | ||
jobs: | ||
tests: | ||
name: ${{ matrix.test }} tests on ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
#TODO(ved): enable macos once we port to go-subkey on gsrpc | ||
os: [ubuntu-latest] | ||
test: [unit, cmd, integration, testworld] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these run in parallel? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeap |
||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
MATRIX_TEST: ${{ matrix.test }} | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/pkg/mod | ||
key: ${{ runner.os }}-go-${{ matrix.test }} | ||
- name: Run tests | ||
run: | | ||
if [ "${MATRIX_TEST}" != "unit" ]; then | ||
[[ -s ${HOME}/.nvm/nvm.sh ]] && . ${HOME}/.nvm/nvm.sh # This loads NVM | ||
nvm install 10.15.1 | ||
nvm alias default 10.15.1 | ||
npm install -g [email protected] | ||
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume | ||
. ${HOME}/.nix-profile/etc/profile.d/nix.sh | ||
nix-env -iA cachix -f https://cachix.org/api/v1/install | ||
cachix use dapp | ||
git clone --recursive https://github.com/dapphub/dapptools ${HOME}/.dapp/dapptools | ||
bash -c "cd ${HOME}/.dapp/dapptools && git checkout b76035185e67be430d851af81ad62c5f42c3e965" | ||
nix-env -f ${HOME}/.dapp/dapptools -iA dapp seth solc | ||
fi | ||
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH | ||
make install-deps | ||
make install-subkey | ||
test=${{ matrix.test }} make run-tests | ||
- name: Upload coverage | ||
run: bash <(curl -s https://codecov.io/bash) |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these secrets configured?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github secrets. they are decrypted transparently only pushed to develop or master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they should be present under project settings