forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from evalsocket/feature/release
Added GitHub action workflow
- Loading branch information
Showing
8 changed files
with
186 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Master | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
# Duplicated from pull request workflow because sharing is not yet supported | ||
build-docker: | ||
name: Build Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- id: load-docker-cache | ||
name: Load Docker Cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: /tmp/tmp/docker-images | ||
key: /tmp/docker-images-${{ github.event.after }} | ||
restore-keys: | | ||
/tmp/docker-images-${{ github.event.before }} | ||
/tmp/docker-images-${{ github.event.pull_request.base.sha }} | ||
- name: Prime docker cache | ||
run: (docker load -i /tmp/tmp/docker-images/snapshot-builder.tar || true) && (docker load -i /tmp/tmp/docker-images/snapshot.tar || true) | ||
- name: Build dockerfile | ||
run: | | ||
docker build -t lyft/${{ github.event.repository.name }}:builder --target builder --cache-from=lyft/${{ github.event.repository.name }}:builder . | ||
docker build -t lyft/${{ github.event.repository.name }}:latest --cache-from=lyft/${{ github.event.repository.name }}:builder . | ||
- name: Tag and cache docker image | ||
run: mkdir -p /tmp/tmp/docker-images && docker save lyft/${{ github.event.repository.name }}:builder -o /tmp/tmp/docker-images/snapshot-builder.tar && docker save lyft/${{ github.event.repository.name }}:latest -o /tmp/tmp/docker-images/snapshot.tar | ||
|
||
bump-version: | ||
name: Bump Version | ||
if: github.actor != 'goreleaserbot' | ||
runs-on: ubuntu-latest | ||
needs: build-docker # Only to ensure it can successfully build | ||
outputs: | ||
version: ${{ steps.bump-version.outputs.tag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
- name: Bump version and push tag | ||
id: bump-version | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
DEFAULT_BUMP: patch | ||
|
||
push-github: | ||
name: Push to Github Registry | ||
runs-on: ubuntu-latest | ||
needs: bump-version | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
- name: Push Docker Image to Github Registry | ||
uses: whoan/docker-build-with-cache-action@v5 | ||
with: | ||
username: "${{ secrets.FLYTE_BOT_USERNAME }}" | ||
password: "${{ secrets.FLYTE_BOT_PAT }}" | ||
image_name: ${{ github.repository }} | ||
image_tag: latest,${{ github.sha }},${{ needs.bump-version.outputs.version }} | ||
push_git_tag: true | ||
registry: ghcr.io | ||
build_extra_args: "--compress=true" | ||
|
||
tests-lint: | ||
name: Run tests and lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
- name: Unit Tests | ||
uses: cedrickring/[email protected] | ||
env: | ||
GO111MODULE: "on" | ||
with: | ||
args: make install && make test_unit_codecov | ||
- name: Push CodeCov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: coverage.txt | ||
flags: unittests | ||
fail_ci_if_error: true | ||
- name: Lint | ||
uses: cedrickring/[email protected] | ||
env: | ||
GO111MODULE: "on" | ||
with: | ||
args: make install && 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,55 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request | ||
|
||
jobs: | ||
build-docker: | ||
name: Build Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- id: load-docker-cache | ||
name: Load Docker Cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: /tmp/tmp/docker-images | ||
key: /tmp/docker-images-${{ github.event.after }} | ||
restore-keys: | | ||
/tmp/docker-images-${{ github.event.before }} | ||
/tmp/docker-images-${{ github.event.pull_request.base.sha }} | ||
- name: Prime docker cache | ||
run: (docker load -i /tmp/tmp/docker-images/snapshot-builder.tar || true) && (docker load -i /tmp/tmp/docker-images/snapshot.tar || true) | ||
- name: Build dockerfile | ||
run: | | ||
docker build -t lyft/${{ github.event.repository.name }}:builder --target builder --cache-from=lyft/${{ github.event.repository.name }}:builder . | ||
docker build -t lyft/${{ github.event.repository.name }}:latest --cache-from=lyft/${{ github.event.repository.name }}:builder . | ||
- name: Tag and cache docker image | ||
run: mkdir -p /tmp/tmp/docker-images && docker save lyft/${{ github.event.repository.name }}:builder -o /tmp/tmp/docker-images/snapshot-builder.tar && docker save lyft/${{ github.event.repository.name }}:latest -o /tmp/tmp/docker-images/snapshot.tar | ||
|
||
tests-lint: | ||
name: Run tests and lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Unit Tests | ||
uses: cedrickring/[email protected] | ||
env: | ||
GO111MODULE: "on" | ||
with: | ||
args: make install && make test_unit_codecov | ||
- name: Push CodeCov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: coverage.txt | ||
flags: unittests | ||
fail_ci_if_error: true | ||
- name: Lint | ||
uses: cedrickring/[email protected] | ||
env: | ||
GO111MODULE: "on" | ||
with: | ||
args: make install && 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,22 @@ | ||
run: | ||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gas | ||
- goconst | ||
- goimports | ||
- golint | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck |
Validating CODEOWNERS rules …
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,3 @@ | ||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence. | ||
* @EngHabu @kumare3 |
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,3 @@ | ||
This project is governed by [Lyft's code of | ||
conduct](https://github.com/lyft/code-of-conduct). All contributors | ||
and participants agree to abide by its terms. |
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
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