2023-05-12 10:21:28 +09:00
|
|
|
name: compliance
|
2023-05-04 11:04:02 +09:00
|
|
|
|
2023-05-16 11:53:18 +09:00
|
|
|
on:
|
|
|
|
pull_request:
|
2023-05-04 11:04:02 +09:00
|
|
|
|
2023-05-05 07:21:48 +09:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-05-04 11:04:02 +09:00
|
|
|
jobs:
|
2023-05-25 10:33:31 +09:00
|
|
|
files-changed:
|
|
|
|
uses: ./.github/workflows/files-changed.yml
|
|
|
|
|
2023-05-12 10:21:28 +09:00
|
|
|
lint-backend:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-25 10:33:31 +09:00
|
|
|
needs: files-changed
|
2023-05-04 11:04:02 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-05-12 10:21:28 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
2023-05-04 11:04:02 +09:00
|
|
|
with:
|
2023-08-11 06:53:44 +09:00
|
|
|
go-version: "~1.21"
|
2023-05-06 16:43:56 +09:00
|
|
|
check-latest: true
|
2023-05-12 10:21:28 +09:00
|
|
|
- run: make deps-backend deps-tools
|
|
|
|
- run: make lint-backend
|
2023-05-04 11:04:02 +09:00
|
|
|
env:
|
|
|
|
TAGS: bindata sqlite sqlite_unlock_notify
|
2023-05-30 14:31:00 +09:00
|
|
|
|
2023-06-15 03:17:58 +09:00
|
|
|
lint-templates:
|
|
|
|
if: needs.files-changed.outputs.templates == 'true'
|
|
|
|
needs: files-changed
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.11"
|
|
|
|
- run: pip install poetry
|
|
|
|
- run: make deps-py
|
|
|
|
- run: make lint-templates
|
|
|
|
|
2023-06-29 23:37:41 +09:00
|
|
|
lint-swagger:
|
|
|
|
if: needs.files-changed.outputs.swagger == 'true'
|
|
|
|
needs: files-changed
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
- run: make deps-frontend
|
|
|
|
- run: make lint-swagger
|
|
|
|
|
2023-05-12 10:21:28 +09:00
|
|
|
lint-go-windows:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-25 10:33:31 +09:00
|
|
|
needs: files-changed
|
2023-05-04 11:04:02 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-05-12 10:21:28 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
2023-05-04 11:04:02 +09:00
|
|
|
with:
|
2023-08-11 06:53:44 +09:00
|
|
|
go-version: "~1.21"
|
2023-05-06 16:43:56 +09:00
|
|
|
check-latest: true
|
2023-05-12 10:21:28 +09:00
|
|
|
- run: make deps-backend deps-tools
|
|
|
|
- run: make lint-go-windows lint-go-vet
|
2023-05-04 11:04:02 +09:00
|
|
|
env:
|
|
|
|
TAGS: bindata sqlite sqlite_unlock_notify
|
|
|
|
GOOS: windows
|
|
|
|
GOARCH: amd64
|
2023-05-30 14:31:00 +09:00
|
|
|
|
2023-05-12 10:21:28 +09:00
|
|
|
lint-go-gogit:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-25 10:33:31 +09:00
|
|
|
needs: files-changed
|
2023-05-04 11:04:02 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-05-12 10:21:28 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
2023-05-04 11:04:02 +09:00
|
|
|
with:
|
2023-08-11 06:53:44 +09:00
|
|
|
go-version: "~1.21"
|
2023-05-06 16:43:56 +09:00
|
|
|
check-latest: true
|
2023-05-12 10:21:28 +09:00
|
|
|
- run: make deps-backend deps-tools
|
|
|
|
- run: make lint-go
|
2023-05-04 11:04:02 +09:00
|
|
|
env:
|
|
|
|
TAGS: bindata gogit sqlite sqlite_unlock_notify
|
2023-05-30 14:31:00 +09:00
|
|
|
|
2023-05-12 10:21:28 +09:00
|
|
|
checks-backend:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-25 10:33:31 +09:00
|
|
|
needs: files-changed
|
2023-05-04 11:04:02 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-05-12 10:21:28 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
2023-05-04 11:04:02 +09:00
|
|
|
with:
|
2023-08-11 06:53:44 +09:00
|
|
|
go-version: "~1.21"
|
2023-05-06 16:43:56 +09:00
|
|
|
check-latest: true
|
2023-05-12 10:21:28 +09:00
|
|
|
- run: make deps-backend deps-tools
|
|
|
|
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
|
2023-05-30 14:31:00 +09:00
|
|
|
|
2023-05-04 11:04:02 +09:00
|
|
|
frontend:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-25 10:33:31 +09:00
|
|
|
needs: files-changed
|
2023-05-04 11:04:02 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-05-12 10:21:28 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2023-05-04 11:04:02 +09:00
|
|
|
with:
|
2023-05-05 07:21:48 +09:00
|
|
|
node-version: 20
|
2023-05-12 10:21:28 +09:00
|
|
|
- run: make deps-frontend
|
|
|
|
- run: make lint-frontend
|
|
|
|
- run: make checks-frontend
|
2023-06-23 06:37:50 +09:00
|
|
|
- run: make test-frontend
|
2023-06-15 00:30:37 +09:00
|
|
|
- run: make frontend
|
2023-05-30 14:31:00 +09:00
|
|
|
|
2023-05-04 11:04:02 +09:00
|
|
|
backend:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-25 10:33:31 +09:00
|
|
|
needs: files-changed
|
2023-05-04 11:04:02 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-05-12 10:21:28 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
2023-05-04 11:04:02 +09:00
|
|
|
with:
|
2023-08-11 06:53:44 +09:00
|
|
|
go-version: "~1.21"
|
2023-05-06 16:43:56 +09:00
|
|
|
check-latest: true
|
2023-06-15 00:30:37 +09:00
|
|
|
# no frontend build here as backend should be able to build
|
|
|
|
# even without any frontend files
|
2023-06-23 08:24:55 +09:00
|
|
|
- run: make deps-backend
|
2023-05-12 10:21:28 +09:00
|
|
|
- run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
|
2023-05-04 11:04:02 +09:00
|
|
|
- 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
|
2023-05-30 14:31:00 +09:00
|
|
|
|
|
|
|
docs:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-30 14:31:00 +09:00
|
|
|
needs: files-changed
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
- run: make deps-frontend
|
|
|
|
- run: make lint-md
|
2023-07-26 13:53:13 +09:00
|
|
|
- run: make docs
|
2023-05-30 14:31:00 +09:00
|
|
|
|
|
|
|
actions:
|
2023-06-15 00:30:37 +09:00
|
|
|
if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
|
2023-05-30 14:31:00 +09:00
|
|
|
needs: files-changed
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
- run: make lint-actions
|