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