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