From 8a948a293510d4ade584708247844f6c367a65ee Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Thu, 17 Aug 2023 17:07:18 +0900 Subject: [PATCH] add ci settings --- .github/ISSUE_TEMPLATE/bug_report.md | 29 +++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++ .github/pull_request_template.md | 3 ++ .github/workflows/lint.yml | 22 ++++++++++++ .github/workflows/release.yml | 43 +++++++++++++++++++++++ .github/workflows/test.yml | 38 ++++++++++++++++++++ 6 files changed, 155 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..d84f8655 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +** Related Components ** +- [ ] protoc-gen-grpc-federation +- [ ] grpc-federation-linter +- [ ] grpc-federation-language-server +- [ ] others + +**To Reproduce** +Steps to reproduce the behavior. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..7de6bf76 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,3 @@ +## NOTE + +Currently, we do not accept pull requests from anyone other than the development team. Please report feature addition requests or bug fix requests via [Issues](https://github.com/kouzoh/grpc-federation/issues). diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..e7f84162 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: lint +on: + push: + branches: + - main + pull_request: +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + - name: checkout + uses: actions/checkout@v3 + - name: install tools + run: make tools + - name: build tools + run: make build + - name: run lint + run: make lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..4f7474c9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: release +on: + push: + tags: + - "v*.*.*" + +jobs: + publish: + name: release vscode extension + runs-on: ubuntu-latest + steps: + - name: install npx + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y npm nodejs + sudo npm -g install n + sudo n stable + - name: checkout + uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + - name: extract version from tags + id: meta + run: | + echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: build extension + run: | + make build/vscode-extension + env: + VERSION: ${{ steps.meta.outputs.VERSION }} + - name: move built extension to publish directory + run: | + mkdir assets + mv ./lsp/client/vscode/grpc-federation-*.vsix assets/ + - name: release + uses: softprops/action-gh-release@v1 + with: + draft: true + generate_release_notes: true + fail_on_unmatched_files: true + files: | + ./assets/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..c1f08e24 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: test +on: + push: + branches: + - main + pull_request: +jobs: + build_and_generate: + name: build and generate + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + - name: checkout + uses: actions/checkout@v3 + - name: install tools + run: make tools + - name: build plugin + run: make build + - name: generate files + run: make generate + - name: check diff + run: git diff --exit-code + test: + name: test + runs-on: ubuntu-latest + steps: + - name: setup go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + - name: checkout + uses: actions/checkout@v3 + - name: install tools + run: make tools + - name: run test + run: make test