-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add log, Update CI and Makefile (#19)
* Add log * Update CI * Update Makefile * Create tools/generatewalker.bash
- Loading branch information
Showing
4 changed files
with
27 additions
and
20 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 |
---|---|---|
|
@@ -10,44 +10,43 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
## NOTE(djeeno): ref. https://docs.github.com/actions/reference/events-that-trigger-workflows#schedule | ||
#schedule: | ||
# - cron: '30 * * * *' | ||
|
||
env: | ||
REPOSITORY_PATH: src/github.com/djeeno/bqtableschema | ||
#COVERAGE_HTML: src/github.com/djeeno/bqtableschema/coverage.html | ||
# NOTE(djeeno): ref. https://docs.github.com/actions/reference/events-that-trigger-workflows#schedule | ||
schedule: | ||
- cron: '0 9 * * *' | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
# NOTE(djeeno): https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.REPOSITORY_PATH }} | ||
|
||
# NOTE(djeeno): https://github.com/actions/setup-go#usage | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.15 | ||
|
||
# https://github.com/actions/cache/blob/main/examples.md#go---modules | ||
# NOTE(djeeno): https://github.com/actions/cache/blob/main/examples.md#go---modules | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ github.workspace }}/pkg/mod | ||
path: | | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
${{ runner.os }}-go- | ||
- name: Run go mod download if not cache hit | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
# NOTE(djeeno): https://github.com/actions/cache#skipping-steps-based-on-cache-hit | ||
- name: Run go mod tidy (if not cache hit) | ||
env: | ||
GO111MODULE: auto | ||
working-directory: ${{ env.REPOSITORY_PATH }} | ||
run: | | ||
go mod download | ||
go mod tidy | ||
git diff --exit-code go.mod | ||
git diff --exit-code go.sum | ||
# NOTE(djeeno): https://github.com/google-github-actions/setup-gcloud#usage | ||
- uses: google-github-actions/[email protected] | ||
with: | ||
project_id: ${{ secrets.GCLOUD_PROJECT_ID }} ## NOTE(djeeno): JSON の中の project_id に相当。 GitHub Actions のログに出ないようにするため | ||
|
@@ -58,16 +57,17 @@ jobs: | |
- name: Run make ci | ||
env: | ||
GO111MODULE: auto | ||
working-directory: ${{ env.REPOSITORY_PATH }} | ||
run: | | ||
make ci | ||
# NOTE(djeeno): https://github.com/actions/upload-artifact#usage | ||
#- uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: coverage.html | ||
# path: ${{ env.COVERAGE_HTML }} | ||
# path: ./coverage.html | ||
|
||
# NOTE(djeeno): https://github.com/codecov/codecov-action#example-workflowyml-with-codecov-action | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
directory: ${{ env.REPOSITORY_PATH }} | ||
file: ./coverage.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -E -e -o pipefail | ||
|
||
grep "^\t*//go:generate go run github.com/djeeno/bqtableschema" -r "$(pwd)" -l | xargs -I{} bash -cx "go generate {}" |