-
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 #1 from phoops/feature/github_action
Feature/GitHub action
- Loading branch information
Showing
6 changed files
with
241 additions
and
5 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,26 @@ | ||
name: Golang test flow | ||
on: [push] | ||
jobs: | ||
transitland-route-geometry-generator-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | ||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | ||
- run: echo "🖥️ The workflow is now ready to test your code on the runner." | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
- name: Docker Compose Test Environment | ||
uses: isbang/[email protected] | ||
with: | ||
down-flags: '--volumes' | ||
compose-file: './docker-compose.yaml' | ||
- name: Golang setup | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.16.4' | ||
- name: Go test | ||
run: go test -v ./... |
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,53 @@ | ||
--- | ||
name: Github release flow | ||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
release-build-attach: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | ||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
- name: Build linux binary | ||
run: task build-transitland-route-geometry-generator-prod | ||
- name: Store Linux binary | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: transitland-route-geometry-generator-linux | ||
path: ${{ github.workspace }}/build/transitland-route-geometry-generator | ||
- name: Download Linux binary | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: transitland-route-geometry-generator-linux | ||
- name: Attach Linux binary to GitHub release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ github.workspace }}/transitland-route-geometry-generator-linux/transitland-route-geometry-generator | ||
asset_name: transitland-route-geometry-generator-linux | ||
asset_label: Linux binary | ||
asset_content_type: application/binary | ||
|
||
|
||
|
||
release-notes: | ||
needs: release-build-attach | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
- run: npm install github-release-notes -g | ||
- run: gren release --override | ||
env: | ||
GREN_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,46 @@ | ||
--- | ||
name: Docker release flow | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
jobs: | ||
transitland-route-geometry-generator-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | ||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | ||
- run: echo "🖥️ The workflow is now ready to test your code on the runner." | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
- name: Docker Compose Test Environment | ||
uses: isbang/[email protected] | ||
with: | ||
down-flags: '--volumes' | ||
compose-file: './docker-compose.yaml' | ||
- name: Golang setup | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.16.4' | ||
- name: Go test | ||
run: go test -v ./... | ||
transitland-route-geometry-generator-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build docker image | ||
run: task build-and-push-docker-images | ||
env: | ||
RELEASE_TAG: ${{ github.ref_name }} |
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