diff --git a/.gitea/workflows/go-generate-check.yaml b/.gitea/workflows/go-generate-check.yaml new file mode 100644 index 0000000..214e9db --- /dev/null +++ b/.gitea/workflows/go-generate-check.yaml @@ -0,0 +1,34 @@ +name: go-generate-check +on: + push: + branches: ['main'] + paths: + - '**.go' + - '**.mod' + - '**.sum' + pull_request: + paths: + - '**.go' + - '**.mod' + - '**.sum' + workflow_dispatch: +jobs: + go-generate-check: + name: go-generate-check + container: + image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest + steps: + - run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} . + - run: git fetch origin ${{ gitea.ref }} + - run: git checkout FETCH_HEAD + - run: go generate -C common + - run: go generate -C workflow-pr + - run: go generate -C workflow-pr/interfaces + - run: git add -N .; git diff + - run: | + status=$(git status --short) + if [[ -n "$status" ]]; then + echo -e "$status" + echo "Please commit the differences from running: go generate" + false + fi diff --git a/.gitea/workflows/go-generate-push.yaml b/.gitea/workflows/go-generate-push.yaml new file mode 100644 index 0000000..f522e82 --- /dev/null +++ b/.gitea/workflows/go-generate-push.yaml @@ -0,0 +1,25 @@ +name: go-generate-push +on: + workflow_dispatch: +jobs: + go-generate-push: + name: go-generate-push + container: + image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest + steps: + - run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} . + - run: git fetch origin ${{ gitea.ref }} + - run: git checkout FETCH_HEAD + - run: go generate -C common + - run: go generate -C workflow-pr + - run: go generate -C workflow-pr/interfaces + - run: | + host=${{ gitea.server_url }} + host=${host#https://} + echo $host + git remote set-url origin "https://x-access-token:${{ secrets.GITEA_TOKEN }}@$host/${{ gitea.repository }}" + git config user.name "Gitea Actions" + git config user.email "gitea_noreply@opensuse.org" + - run: 'git status --short; git status --porcelain=2|grep --quiet -v . || ( git add .;git commit -m "CI run result of: go generate"; git push origin HEAD:${{ gitea.ref }} )' + - run: git log -p FETCH_HEAD...HEAD + - run: git log --numstat FETCH_HEAD...HEAD diff --git a/.gitea/workflows/go-vendor-check.yaml b/.gitea/workflows/go-vendor-check.yaml new file mode 100644 index 0000000..6cb203f --- /dev/null +++ b/.gitea/workflows/go-vendor-check.yaml @@ -0,0 +1,33 @@ +name: go-vendor-check +on: + push: + branches: ['main'] + paths: + - '**.mod' + - '**.sum' + pull_request: + paths: + - '**.mod' + - '**.sum' + workflow_dispatch: +jobs: + go-generate-check: + name: go-vendor-check + container: + image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest + steps: + - run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} . + - run: git fetch origin ${{ gitea.ref }} + - run: git checkout FETCH_HEAD + - run: go mod download + - run: go mod vendor + - run: go mod verify + - run: git add -N .; git diff + - run: go mod tidy -diff || true + - run: | + status=$(git status --short) + if [[ -n "$status" ]]; then + echo -e "$status" + echo "Please commit the differences from running: go generate" + false + fi diff --git a/.gitea/workflows/go-vendor-push.yaml b/.gitea/workflows/go-vendor-push.yaml new file mode 100644 index 0000000..8344388 --- /dev/null +++ b/.gitea/workflows/go-vendor-push.yaml @@ -0,0 +1,26 @@ +name: go-generate-push +on: + workflow_dispatch: +jobs: + go-generate-push: + name: go-generate-push + container: + image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest + steps: + - run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} . + - run: git fetch origin ${{ gitea.ref }} + - run: git checkout FETCH_HEAD + - run: go mod download + - run: go mod vendor + - run: go mod verify + - run: | + host=${{ gitea.server_url }} + host=${host#https://} + echo $host + git remote set-url origin "https://x-access-token:${{ secrets.GITEA_TOKEN }}@$host/${{ gitea.repository }}" + git config user.name "Gitea Actions" + git config user.email "gitea_noreply@opensuse.org" + - run: 'git status --short; git status --porcelain=2|grep --quiet -v . || ( git add .;git commit -m "CI run result of: go mod vendor"; git push origin HEAD:${{ gitea.ref }} )' + - run: go mod tidy -diff || true + - run: git log -p FETCH_HEAD...HEAD + - run: git log --numstat FETCH_HEAD...HEAD diff --git a/.gitignore b/.gitignore index c96d638..77e84d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ mock -node_modules -*.obscpio -autogits-tmp.tar.zst *.osc *.conf diff --git a/_service b/_service deleted file mode 100644 index c531f21..0000000 --- a/_service +++ /dev/null @@ -1,15 +0,0 @@ - - - - . - true - autogits-tmp.tar.zst - autogits-tmp.tar.zst - - - ./ - zst - vendor - - -