123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- name: compliance
-
- on:
- pull_request:
-
- concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
- jobs:
- files-changed:
- uses: ./.github/workflows/files-changed.yml
-
- lint-backend:
- if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version-file: go.mod
- check-latest: true
- - run: make deps-backend deps-tools
- - run: make lint-backend
- env:
- TAGS: bindata sqlite sqlite_unlock_notify
-
- lint-templates:
- if: needs.files-changed.outputs.templates == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: "3.12"
- - uses: actions/setup-node@v4
- with:
- node-version: 20
- - run: pip install poetry
- - run: make deps-py
- - run: make deps-frontend
- - run: make lint-templates
-
- lint-yaml:
- if: needs.files-changed.outputs.yaml == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: "3.12"
- - run: pip install poetry
- - run: make deps-py
- - run: make lint-yaml
-
- lint-swagger:
- if: needs.files-changed.outputs.swagger == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 20
- - run: make deps-frontend
- - run: make lint-swagger
-
- lint-spell:
- if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.templates == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version-file: go.mod
- check-latest: true
- - run: make lint-spell
-
- lint-go-windows:
- if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version-file: go.mod
- check-latest: true
- - run: make deps-backend deps-tools
- - run: make lint-go-windows lint-go-vet
- env:
- TAGS: bindata sqlite sqlite_unlock_notify
- GOOS: windows
- GOARCH: amd64
-
- lint-go-gogit:
- if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version-file: go.mod
- check-latest: true
- - run: make deps-backend deps-tools
- - run: make lint-go
- env:
- TAGS: bindata gogit sqlite sqlite_unlock_notify
-
- checks-backend:
- if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version-file: go.mod
- check-latest: true
- - run: make deps-backend deps-tools
- - run: make --always-make checks-backend # ensure the "go-licenses" make target runs
-
- frontend:
- if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 20
- - run: make deps-frontend
- - run: make lint-frontend
- - run: make checks-frontend
- - run: make test-frontend
- - run: make frontend
-
- backend:
- if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version-file: go.mod
- check-latest: true
- # no frontend build here as backend should be able to build
- # even without any frontend files
- - run: make deps-backend
- - run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
- - name: build-backend-arm64
- run: make backend # test cross compile
- env:
- GOOS: linux
- GOARCH: arm64
- TAGS: bindata gogit
- - name: build-backend-windows
- run: go build -o gitea_windows
- env:
- GOOS: windows
- GOARCH: amd64
- TAGS: bindata gogit
- - name: build-backend-386
- run: go build -o gitea_linux_386 # test if compatible with 32 bit
- env:
- GOOS: linux
- GOARCH: 386
-
- docs:
- if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 20
- - run: make deps-frontend
- - run: make lint-md
- - run: make docs
-
- actions:
- if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
- needs: files-changed
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version-file: go.mod
- check-latest: true
- - run: make lint-actions
|