GeezerVison is showing github.com — add go port · gitLibs/server@6cd4f8b
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .dockerignore -16Lines changed: 0 additions & 16 deletions Collapse file Copy file name to clipboardExpand all lines: .editorconfig -18Lines changed: 0 additions & 18 deletions Collapse file Copy file name to clipboard +22Lines changed: 22 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +name: Base Setup | | 2 | + | | 3 | +description: "basic steps to setup golang tools" | | 4 | + | | 5 | +runs: | | 6 | + using: "composite" | | 7 | + steps: | | 8 | + - name: Install Go | | 9 | + uses: actions/setup-go@v2 | | 10 | + with: | | 11 | + go-version: "^1.17" | | 12 | + | | 13 | + - name: Go Mod Cache | | 14 | + uses: actions/cache@v2 | | 15 | + with: | | 16 | + path: ~/go/pkg/mod | | 17 | + key: ${{ runner.os }}-go-mod-1-${{ hashFiles('**/go.sum') }} | | 18 | + restore-keys: | | | 19 | + ${{ runner.os }}-go-mod-1- | | 20 | +
| | 21 | + - run: make install | | 22 | + shell: bash |
Collapse file Copy file name to clipboard +6-13Lines changed: 6 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -coverage: | 2 | | - precision: 1 | 3 | | - round: down | 4 | | - range: 90...95 # custom range of coverage colors from red -> yellow -> green | 5 | | - status: | 6 | | - project: | 7 | | - default: | 8 | | - # basic | 9 | | - target: 99% | 10 | | - threshold: 1% | 11 | | - | 12 | | -codecov: | 13 | | - require_ci_to_pass: true | | 1 | +ignore: | | 2 | + - "**/mock_*.go" | | 3 | + - "**/*_test.go" | | 4 | + - "**/*.gen.go" | | 5 | + - "dal/query/gen.go" | | 6 | + - "cmd/gen/gorm.go" |
Collapse file Copy file name to clipboardExpand all lines: .github/pull_request_template.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -如果你的 PR 添加了新的 API,请针对每一个 API 填写以下部分 | | 1 | +<!-- 如果你的 PR 添加了新的 API,请针对每一个 API 填写以下部分 --> | 2 | 2 |
| 3 | 3 | <details> | 4 | 4 | <summary> New API Name </summary> | |
Collapse file Copy file name to clipboardExpand all lines: .github/renovate.json +7-21Lines changed: 7 additions & 21 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", | 3 | 3 | "extends": [ | 4 | 4 | "local>Trim21/renovate-config", | 5 | | - "local>Trim21/renovate-config:monthly", | 6 | | - "local>Trim21/renovate-config:poetry" | | 5 | + "local>Trim21/renovate-config:monthly" | 7 | 6 | ], | 8 | | - "separateMajorMinor": true, | 9 | 7 | "separateMinorPatch": false, | 10 | | - "rangeStrategy": "pin", | 11 | | - "pre-commit": { | 12 | | - "enabled": true | 13 | | - }, | | 8 | + "separateMajorMinor": true, | | 9 | + "separateMultipleMajor": true, | 14 | 10 | "packageRules": [ | 15 | 11 | { | 16 | | - "matchManagers": ["pre-commit"], | 17 | | - "semanticCommitType": "chore", | 18 | | - "groupName": "deps-dev", | 19 | | - "semanticCommitScope": "dev" | 20 | | - }, | 21 | | - { | 22 | | - "matchManagers": ["dockerfile"], | 23 | | - "rangeStrategy": "pin", | 24 | | - "minor": { | 25 | | - "enabled": false | 26 | | - }, | 27 | | - "major": { | 28 | | - "enabled": false | 29 | | - } | | 12 | + "groupName": "deps", | | 13 | + "matchManagers": ["gomod"], | | 14 | + "semanticCommitType": "build", | | 15 | + "matchUpdateTypes": ["patch", "minor"] | 30 | 16 | } | 31 | 17 | ] | 32 | 18 | } |
Collapse file Copy file name to clipboard +40Lines changed: 40 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +name: Build | | 2 | + | | 3 | +on: | | 4 | + push: | | 5 | + branches: | | 6 | + - master | | 7 | + - go | | 8 | + paths-ignore: | | 9 | + - "**.md" | | 10 | + - "**.txt" | | 11 | + pull_request: | | 12 | + branches: | | 13 | + - master | | 14 | + - go | | 15 | + paths-ignore: | | 16 | + - "**.md" | | 17 | + - "**.txt" | | 18 | + | | 19 | +jobs: | | 20 | + build: | | 21 | + runs-on: ubuntu-latest | | 22 | + steps: | | 23 | + - uses: actions/checkout@v2 | | 24 | + | | 25 | + - uses: ./.github/actions/base | | 26 | + | | 27 | + - name: Go Build Cache (build) | | 28 | + uses: actions/cache@v2 | | 29 | + with: | | 30 | + path: | | | 31 | + ~/.cache/go-build | | 32 | + key: ${{ runner.os }}-go-build-1-${{ hashFiles('**/go.sum') }}-build | | 33 | + restore-keys: | | | 34 | + ${{ runner.os }}-go-build-1-${{ hashFiles('**/go.sum') }}- | | 35 | + ${{ runner.os }}-go-build-1- | | 36 | +
| | 37 | + - name: Build | | 38 | + run: make build | | 39 | + | | 40 | + - run: docker build . |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/ci.yaml -54Lines changed: 0 additions & 54 deletions Collapse file Copy file name to clipboardExpand all lines: .github/workflows/lint-other.yaml +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | push: | 5 | 5 | branches: | 6 | 6 | - master | | 7 | + - go | 7 | 8 | paths: | 8 | 9 | - "**.md" | 9 | 10 | - "**.py" | 10 | 11 | - "**.yaml" | 11 | 12 | - "**.yml" | 12 | 13 | - "**.html" | 13 | 14 | - "**.json" | 14 | | - - "**.toml" | 15 | 15 | pull_request_target: | 16 | | - types: [opened, synchronize, ready_for_review, reopened] | | 16 | + types: [opened, synchronize, reopened] | 17 | 17 | branches: | 18 | 18 | - master | 19 | 19 | paths: | | 23 | 23 | - "**.yml" | 24 | 24 | - "**.html" | 25 | 25 | - "**.json" | 26 | | - - "**.toml" | 27 | 26 |
| 28 | 27 | jobs: | 29 | 28 | lint-other: | | 32 | 31 | - name: Install Node LTS | 33 | 32 | uses: actions/setup-node@v2 | 34 | 33 |
| 35 | | - - run: npm i -g prettier prettier-plugin-toml | | 34 | + - run: npm i -g prettier | 36 | 35 |
| 37 | 36 | - uses: reviewdog/action-setup@v1 | 38 | 37 | with: | | 60 | 59 | git diff >"${TMPFILE}" | 61 | 60 | git reset --hard HEAD | 62 | 61 |
| 63 | | - reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < "${TMPFILE}" | | 62 | + reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review -tee < "${TMPFILE}" | 64 | 63 | env: | 65 | 64 | REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Collapse file Copy file name to clipboard +24-56Lines changed: 24 additions & 56 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -name: lint | | 1 | +name: Lint | 2 | 2 |
| 3 | 3 | on: | 4 | 4 | push: | 5 | | - branches-ignore: | 6 | | - - renovate/** | | 5 | + branches: | | 6 | + - master | | 7 | + - go | 7 | 8 | paths-ignore: | 8 | 9 | - "**.md" | | 10 | + - "**.txt" | 9 | 11 | pull_request: | 10 | 12 | branches: | 11 | 13 | - master | | 14 | + - go | 12 | 15 | paths-ignore: | 13 | 16 | - "**.md" | | 17 | + - "**.txt" | 14 | 18 |
| 15 | 19 | jobs: | 16 | | - mypy: | 17 | | - runs-on: ubuntu-latest | 18 | | - steps: | 19 | | - - uses: actions/checkout@v2 | 20 | | - | 21 | | - - uses: actions/setup-python@v2 | 22 | | - with: | 23 | | - python-version: 3.8 | 24 | | - | 25 | | - - uses: Trim21/setup-poetry@dist/v1 | 26 | | - | 27 | | - - uses: Trim21/install-poetry-project@dist/v1 | 28 | | - | 29 | | - - uses: liskin/gh-problem-matcher-wrap@v1 | 30 | | - with: | 31 | | - action: add | 32 | | - linters: mypy | 33 | | - | 34 | | - - name: mypy | 35 | | - run: mypy --show-column-numbers pol | 36 | | - | 37 | | - flake8: | | 20 | + lint: | 38 | 21 | runs-on: ubuntu-latest | 39 | 22 | steps: | 40 | 23 | - uses: actions/checkout@v2 | 41 | 24 |
| 42 | | - - uses: actions/setup-python@v2 | 43 | | - with: | 44 | | - python-version: 3.8 | 45 | | - | 46 | | - - uses: Trim21/setup-poetry@dist/v1 | 47 | | - | 48 | | - - uses: Trim21/install-poetry-project@dist/v1 | 49 | | - | 50 | | - - run: echo "::add-matcher::.github/workflows/matcher/flake8.json" | | 25 | + - uses: ./.github/actions/base | 51 | 26 |
| 52 | | - - name: flake8 | 53 | | - run: flake8 | 54 | | - | 55 | | - pre-commit: | 56 | | - runs-on: ubuntu-latest | 57 | | - steps: | 58 | | - - uses: actions/checkout@v2 | 59 | | - | 60 | | - - uses: actions/setup-python@v2 | | 27 | + - name: Go Build Cache (lint) | | 28 | + uses: actions/cache@v2 | 61 | 29 | with: | 62 | | - python-version: 3.8 | 63 | | - | 64 | | - - uses: Trim21/setup-poetry@dist/v1 | 65 | | - | 66 | | - - uses: Trim21/install-poetry-project@dist/v1 | 67 | | - | 68 | | - - uses: actions/cache@v2 | | 30 | + path: | | | 31 | + ~/.cache/go-build | | 32 | + key: ${{ runner.os }}-go-build-1-${{ hashFiles('**/go.sum') }}-lint | | 33 | + restore-keys: | | | 34 | + ${{ runner.os }}-go-build-1-${{ hashFiles('**/go.sum') }}- | | 35 | + ${{ runner.os }}-go-build-1- | | 36 | +
| | 37 | + - name: Run linters | | 38 | + uses: golangci/golangci-lint-action@v2 | 69 | 39 | with: | 70 | | - path: ~/.cache/pre-commit | 71 | | - key: precommit-2-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }} | 72 | | - restore-keys: precommit-2-${{ env.PY }}- | 73 | | - | 74 | | - - name: pre-commit | 75 | | - run: pre-commit run --all-files --show-diff-on-failure && pre-commit gc | | 40 | + version: v1.44.1 | | 41 | + skip-go-installation: true | | 42 | + skip-pkg-cache: true | | 43 | + skip-build-cache: true |
|