-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
264 additions
and
383 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 |
---|---|---|
@@ -1,66 +1,27 @@ | ||
name: CI | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- "*" | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
make: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.4.0 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
- uses: actions/checkout@v2.4.0 | ||
with: | ||
go-version: ~1.16 | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2.5.1 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2.1.5 | ||
with: | ||
node-version: 12 | ||
go-version: ^1.17 | ||
|
||
- name: Make | ||
run: make | ||
|
||
- name: Report Code Coverage | ||
uses: codecov/codecov-action@v2.1.0 | ||
with: | ||
file: ./build/coverage/go-test.txt | ||
file: .mage/tools/go/coverage/go-test.txt | ||
fail_ci_if_error: true | ||
|
||
release: | ||
needs: [ make ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.4.0 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ~1.16 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2.5.1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Run semantic-release | ||
run: make semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run goreleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
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,37 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2.4.0 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2.1.5 | ||
with: | ||
go-version: ^1.17 | ||
|
||
- name: Make | ||
run: make | ||
|
||
- name: Release | ||
uses: go-semantic-release/action@v1.15.0 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
allow-initial-development-versions: true | ||
|
||
- name: Run goreleaser | ||
uses: goreleaser/goreleaser-action@v2.8.0 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
.idea | ||
tools/*/*/ | ||
node_modules/ | ||
build/ | ||
.mage/tools/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module mage-tools | ||
|
||
go 1.17 | ||
|
||
require ( | ||
github.com/magefile/mage v1.12.1 | ||
go.einride.tech/mage-tools v0.11.0 | ||
) | ||
|
||
require ( | ||
github.com/go-logr/logr v1.2.2 // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/iancoleman/strcase v0.2.0 // indirect | ||
) |
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,10 @@ | ||
github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= | ||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= | ||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= | ||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= | ||
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= | ||
github.com/magefile/mage v1.12.1 h1:oGdAbhIUd6iKamKlDGVtU6XGdy5SgNuCWn7gCTgHDtU= | ||
github.com/magefile/mage v1.12.1/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= | ||
go.einride.tech/mage-tools v0.11.0 h1:rLl9vam1K4wEGy+lp8Ry9Zdm2s2+q0q3h73yW7JvcL4= | ||
go.einride.tech/mage-tools v0.11.0/go.mod h1:Z6r1+t7AAzM8G59LtsD8nM4anNGDHyo2lioYRXL8Ggs= |
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,42 @@ | ||
//go:build mage | ||
// +build mage | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/magefile/mage/mg" | ||
"github.com/magefile/mage/sh" | ||
|
||
// mage:import | ||
"go.einride.tech/mage-tools/targets/mgconvco" | ||
|
||
// mage:import | ||
"go.einride.tech/mage-tools/targets/mggo" | ||
|
||
// mage:import | ||
"go.einride.tech/mage-tools/targets/mggolangcilint" | ||
|
||
// mage:import | ||
"go.einride.tech/mage-tools/targets/mgmarkdownfmt" | ||
|
||
// mage:import | ||
"go.einride.tech/mage-tools/targets/mggitverifynodiff" | ||
) | ||
|
||
func All() { | ||
mg.Deps( | ||
mg.F(mgconvco.ConvcoCheck, "origin/master..HEAD"), | ||
mggolangcilint.GolangciLint, | ||
mgmarkdownfmt.FormatMarkdown, | ||
) | ||
mg.SerialDeps( | ||
mggo.GoTest, | ||
SpannerGenerate, | ||
mggo.GoModTidy, | ||
mggitverifynodiff.GitVerifyNoDiff, | ||
) | ||
} | ||
|
||
func SpannerGenerate() error { | ||
return sh.RunV("go", "run", ".", "generate") | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
mage_folder := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) | ||
mage_generated_path := $(mage_folder)/tools/mgmake | ||
mage_tools_path := $(mage_folder)/tools | ||
mage_targets_file := $(mage_generated_path)/targets.mk | ||
mage := $(mage_generated_path)/local-mage | ||
mgmake := $(mage_folder)/mgmake_gen.go | ||
mgmain := $(mage_folder)/mgmain_gen.go | ||
|
||
define mgmake_content | ||
// Code generated by Mage-tools. DO NOT EDIT. | ||
//go:build mage | ||
// +build mage | ||
|
||
package main | ||
|
||
// mage:import | ||
import _ "go.einride.tech/mage-tools/mgmake" | ||
endef | ||
|
||
define mgmain_content | ||
// Code generated by Mage-tools. DO NOT EDIT. | ||
//go:build ignore | ||
// +build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
"github.com/magefile/mage/mage" | ||
) | ||
|
||
func main() { os.Exit(mage.Main()) } | ||
endef | ||
|
||
include $(mage_targets_file) | ||
|
||
$(mage_targets_file): $(mage_folder)/go.mod $(shell find $(mage_folder)/.. -type f -name '*.go') | ||
@git clean -fdx $(mage_generated_path) | ||
@mkdir -p $(mage_generated_path) | ||
$(file > $(mgmake),$(mgmake_content)) | ||
$(file > $(mgmain),$(mgmain_content)) | ||
@cd $(mage_folder) && \ | ||
go mod tidy && \ | ||
go run $(notdir $(mgmain)) -compile $(mage) && \ | ||
$(mage) generateMakefile $(@) | ||
|
||
.PHONY: mage-clean | ||
mage-clean: | ||
@git clean -fdx $(mage_generated_path) $(mage_tools_path) |
Oops, something went wrong.