chore(pre-commit): use google/yamlfmt
This commit is contained in:
parent
441410ae25
commit
defd6072e1
|
@ -1,61 +1,59 @@
|
|||
---
|
||||
name: build
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
- push
|
||||
- pull_request
|
||||
jobs:
|
||||
build:
|
||||
container:
|
||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest
|
||||
volumes:
|
||||
- /home/actions/.ssh:/root/.ssh
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://gitea.com/BoYanZh/checkout@focs
|
||||
- name: Display Go version
|
||||
run: go version
|
||||
- name: Prepare
|
||||
run: |
|
||||
go env -w GO111MODULE=on
|
||||
go env -w GOPROXY=https://goproxy.io,direct
|
||||
chown -R root:root /root/.ssh
|
||||
# - name: Setup Joint-Teapot
|
||||
# run: |
|
||||
# pip install git+https://ghp.ci/https://github.com/BoYanZh/Joint-Teapot
|
||||
- name: Lint
|
||||
run: make lint
|
||||
- name: Build
|
||||
run: make build
|
||||
- name: Version
|
||||
run: ./build/joj3 -version
|
||||
- name: Test
|
||||
run: |
|
||||
make prepare-test
|
||||
make ci-test
|
||||
trigger-build-image:
|
||||
container:
|
||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /home/actions/.ssh:/root/.ssh
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name "gitea-actions[bot]"
|
||||
git config --global user.email "gitea-actions[bot]@users.noreply.gitea.com"
|
||||
chown -R root:root /root/.ssh
|
||||
- name: Clone, Commit and Push
|
||||
shell: bash
|
||||
run: |
|
||||
git clone ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/runner-images.git runner-images
|
||||
cd runner-images
|
||||
git submodule update --init --remote --force
|
||||
git add -A
|
||||
if echo "${{ github.event.head_commit.message }}" | grep -q "force build"; then
|
||||
git commit --allow-empty -m "chore: trigger force build gitea actions by JOJ3"
|
||||
else
|
||||
git commit --allow-empty -m "chore: trigger gitea actions by JOJ3"
|
||||
fi
|
||||
git push
|
||||
build:
|
||||
container:
|
||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest
|
||||
volumes:
|
||||
- /home/actions/.ssh:/root/.ssh
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://gitea.com/BoYanZh/checkout@focs
|
||||
- name: Display Go version
|
||||
run: go version
|
||||
- name: Prepare
|
||||
run: |
|
||||
go env -w GO111MODULE=on
|
||||
go env -w GOPROXY=https://goproxy.io,direct
|
||||
chown -R root:root /root/.ssh
|
||||
# - name: Setup Joint-Teapot
|
||||
# run: |
|
||||
# pip install git+https://ghp.ci/https://github.com/BoYanZh/Joint-Teapot
|
||||
- name: Lint
|
||||
run: make lint
|
||||
- name: Build
|
||||
run: make build
|
||||
- name: Version
|
||||
run: ./build/joj3 -version
|
||||
- name: Test
|
||||
run: |
|
||||
make prepare-test
|
||||
make ci-test
|
||||
trigger-build-image:
|
||||
container:
|
||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /home/actions/.ssh:/root/.ssh
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name "gitea-actions[bot]"
|
||||
git config --global user.email "gitea-actions[bot]@users.noreply.gitea.com"
|
||||
chown -R root:root /root/.ssh
|
||||
- name: Clone, Commit and Push
|
||||
shell: bash
|
||||
run: |
|
||||
git clone ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/runner-images.git runner-images
|
||||
cd runner-images
|
||||
git submodule update --init --remote --force
|
||||
git add -A
|
||||
if echo "${{ github.event.head_commit.message }}" | grep -q "force build"; then
|
||||
git commit --allow-empty -m "chore: trigger force build gitea actions by JOJ3"
|
||||
else
|
||||
git commit --allow-empty -m "chore: trigger gitea actions by JOJ3"
|
||||
fi
|
||||
git push
|
||||
|
|
|
@ -1,49 +1,47 @@
|
|||
---
|
||||
name: submodules sync
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
sync:
|
||||
container:
|
||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /home/actions/.ssh:/root/.ssh
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://gitea.com/BoYanZh/checkout@focs
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name "gitea-actions[bot]"
|
||||
git config --global user.email "gitea-actions[bot]@users.noreply.gitea.com"
|
||||
chown -R root:root /root/.ssh
|
||||
git remote set-url origin ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/JOJ3.git
|
||||
- name: Check Git status
|
||||
run: |
|
||||
echo git remote -v
|
||||
git remote -v
|
||||
echo ssh -T git@focs.ji.sjtu.edu.cn -p 2222
|
||||
ssh -T git@focs.ji.sjtu.edu.cn -p 2222
|
||||
echo git status
|
||||
git status
|
||||
- name: Git Submodule Update
|
||||
run: |
|
||||
git submodule init
|
||||
git submodule update --init --recursive
|
||||
git pull --recurse-submodules
|
||||
git submodule update --remote --recursive
|
||||
- name: Commit update
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch --all
|
||||
git checkout master
|
||||
git reset --hard origin/master
|
||||
git status
|
||||
git add .
|
||||
git status
|
||||
git diff-index --quiet HEAD || git commit -m "chore: update submodule references"
|
||||
git push
|
||||
sync:
|
||||
container:
|
||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /home/actions/.ssh:/root/.ssh
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://gitea.com/BoYanZh/checkout@focs
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name "gitea-actions[bot]"
|
||||
git config --global user.email "gitea-actions[bot]@users.noreply.gitea.com"
|
||||
chown -R root:root /root/.ssh
|
||||
git remote set-url origin ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/JOJ3.git
|
||||
- name: Check Git status
|
||||
run: |
|
||||
echo git remote -v
|
||||
git remote -v
|
||||
echo ssh -T git@focs.ji.sjtu.edu.cn -p 2222
|
||||
ssh -T git@focs.ji.sjtu.edu.cn -p 2222
|
||||
echo git status
|
||||
git status
|
||||
- name: Git Submodule Update
|
||||
run: |
|
||||
git submodule init
|
||||
git submodule update --init --recursive
|
||||
git pull --recurse-submodules
|
||||
git submodule update --remote --recursive
|
||||
- name: Commit update
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch --all
|
||||
git checkout master
|
||||
git reset --hard origin/master
|
||||
git status
|
||||
git add .
|
||||
git status
|
||||
git diff-index --quiet HEAD || git commit -m "chore: update submodule references"
|
||||
git push
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
---
|
||||
linters:
|
||||
enable:
|
||||
- gosec
|
||||
- gocritic
|
||||
- gofumpt
|
||||
- gofmt
|
||||
- goimports
|
||||
enable:
|
||||
- gosec
|
||||
- gocritic
|
||||
- gofumpt
|
||||
- gofmt
|
||||
- goimports
|
||||
issues:
|
||||
exclude-rules:
|
||||
- linters:
|
||||
- gosec
|
||||
text: G601 # false positive since go 1.22
|
||||
exclude-rules:
|
||||
- linters:
|
||||
- gosec
|
||||
text: G601 # false positive since go 1.22
|
||||
|
|
|
@ -1,37 +1,36 @@
|
|||
---
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/mrtazz/checkmake.git
|
||||
rev: 0.2.2
|
||||
hooks:
|
||||
- id: checkmake
|
||||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
|
||||
rev: 0.2.3
|
||||
hooks:
|
||||
- id: yamlfmt
|
||||
- repo: https://github.com/dnephin/pre-commit-golang
|
||||
rev: v0.5.1
|
||||
hooks:
|
||||
- id: golangci-lint
|
||||
- id: go-mod-tidy
|
||||
# - repo: local
|
||||
# hooks:
|
||||
# - id: make-build
|
||||
# name: make build
|
||||
# entry: make build
|
||||
# language: system
|
||||
# always_run: true
|
||||
# stages: [pre-commit]
|
||||
# pass_filenames: false
|
||||
# - id: make-test
|
||||
# name: make test
|
||||
# entry: make test
|
||||
# language: system
|
||||
# always_run: true
|
||||
# stages: [pre-commit]
|
||||
# pass_filenames: false
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/mrtazz/checkmake.git
|
||||
rev: 0.2.2
|
||||
hooks:
|
||||
- id: checkmake
|
||||
- repo: https://github.com/google/yamlfmt
|
||||
rev: v0.13.0
|
||||
hooks:
|
||||
- id: yamlfmt
|
||||
- repo: https://github.com/dnephin/pre-commit-golang
|
||||
rev: v0.5.1
|
||||
hooks:
|
||||
- id: golangci-lint
|
||||
- id: go-mod-tidy
|
||||
# - repo: local
|
||||
# hooks:
|
||||
# - id: make-build
|
||||
# name: make build
|
||||
# entry: make build
|
||||
# language: system
|
||||
# always_run: true
|
||||
# stages: [pre-commit]
|
||||
# pass_filenames: false
|
||||
# - id: make-test
|
||||
# name: make test
|
||||
# entry: make test
|
||||
# language: system
|
||||
# always_run: true
|
||||
# stages: [pre-commit]
|
||||
# pass_filenames: false
|
||||
|
|
Loading…
Reference in New Issue
Block a user