mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 14:35:40 +00:00
Split backend building boilerplate
This commit is contained in:
parent
5b84756137
commit
c0b17a06ef
15
.forgejo/workflows/composite/build-backend/action.yaml
Normal file
15
.forgejo/workflows/composite/build-backend/action.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
su forgejo -c 'make deps-backend'
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
id: cache-backend
|
||||||
|
with:
|
||||||
|
path: '/workspace/forgejo/forgejo/gitea'
|
||||||
|
key: backend-build-${{ github.sha }}
|
||||||
|
- if: steps.cache-backend.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
su forgejo -c 'make backend'
|
||||||
|
env:
|
||||||
|
TAGS: bindata
|
|
@ -21,16 +21,9 @@ jobs:
|
||||||
EOF
|
EOF
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v3
|
- uses: https://code.forgejo.org/actions/checkout@v3
|
||||||
- uses: ./.forgejo/workflows/composite/setup-env
|
- uses: ./.forgejo/workflows/composite/setup-env
|
||||||
- run: make deps-backend deps-tools
|
- run: su forgejo -c 'make deps-backend deps-tools'
|
||||||
- run: make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate # ensure the "go-licenses" make target runs
|
- run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate' # ensure the "go-licenses" make target runs
|
||||||
- run: |
|
- uses: ./.forgejo/workflows/composite/build-backend
|
||||||
make backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: '/workspace/forgejo/forgejo/gitea'
|
|
||||||
key: backend-build-${{ github.sha }}
|
|
||||||
frontend-checks:
|
frontend-checks:
|
||||||
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
|
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
@ -78,18 +71,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
apt-get -q install -qq -y jq
|
apt-get -q install -qq -y jq
|
||||||
./release-notes-assistant.sh test_main
|
./release-notes-assistant.sh test_main
|
||||||
- run: |
|
- uses: ./.forgejo/workflows/composite/build-backend
|
||||||
su forgejo -c 'make deps-backend'
|
|
||||||
- uses: actions/cache/restore@v4
|
|
||||||
id: cache-backend
|
|
||||||
with:
|
|
||||||
path: '/workspace/forgejo/forgejo/gitea'
|
|
||||||
key: backend-build-${{ github.sha }}
|
|
||||||
- if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
su forgejo -c 'make backend'
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- run: |
|
- run: |
|
||||||
su forgejo -c 'make test-backend test-check'
|
su forgejo -c 'make test-backend test-check'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
|
@ -133,18 +115,7 @@ jobs:
|
||||||
apt-get -q install -qq -y git
|
apt-get -q install -qq -y git
|
||||||
rm /etc/apt/sources.list.d/testing.list
|
rm /etc/apt/sources.list.d/testing.list
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
- run: |
|
- uses: ./.forgejo/workflows/composite/build-backend
|
||||||
su forgejo -c 'make deps-backend'
|
|
||||||
- uses: actions/cache/restore@v4
|
|
||||||
id: cache-backend
|
|
||||||
with:
|
|
||||||
path: '/workspace/forgejo/forgejo/gitea'
|
|
||||||
key: backend-build-${{ github.sha }}
|
|
||||||
- if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
su forgejo -c 'make backend'
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- run: |
|
- run: |
|
||||||
su forgejo -c 'make test-remote-cacher test-check'
|
su forgejo -c 'make test-remote-cacher test-check'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
|
@ -179,18 +150,7 @@ jobs:
|
||||||
apt-get install --no-install-recommends -qq -y git git-lfs
|
apt-get install --no-install-recommends -qq -y git git-lfs
|
||||||
rm /etc/apt/sources.list.d/testing.list
|
rm /etc/apt/sources.list.d/testing.list
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
- run: |
|
- uses: ./.forgejo/workflows/composite/build-backend
|
||||||
su forgejo -c 'make deps-backend'
|
|
||||||
- uses: actions/cache/restore@v4
|
|
||||||
id: cache-backend
|
|
||||||
with:
|
|
||||||
path: '/workspace/forgejo/forgejo/gitea'
|
|
||||||
key: backend-build-${{ github.sha }}
|
|
||||||
- if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
su forgejo -c 'make backend'
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- run: |
|
- run: |
|
||||||
su forgejo -c 'make test-mysql-migration test-mysql'
|
su forgejo -c 'make test-mysql-migration test-mysql'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
|
@ -226,18 +186,7 @@ jobs:
|
||||||
apt-get install --no-install-recommends -qq -y git git-lfs
|
apt-get install --no-install-recommends -qq -y git git-lfs
|
||||||
rm /etc/apt/sources.list.d/testing.list
|
rm /etc/apt/sources.list.d/testing.list
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
- run: |
|
- uses: ./.forgejo/workflows/composite/build-backend
|
||||||
su forgejo -c 'make deps-backend'
|
|
||||||
- uses: actions/cache/restore@v4
|
|
||||||
id: cache-backend
|
|
||||||
with:
|
|
||||||
path: '/workspace/forgejo/forgejo/gitea'
|
|
||||||
key: backend-build-${{ github.sha }}
|
|
||||||
- if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
su forgejo -c 'make backend'
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- run: |
|
- run: |
|
||||||
su forgejo -c 'make test-pgsql-migration test-pgsql'
|
su forgejo -c 'make test-pgsql-migration test-pgsql'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
|
@ -262,18 +211,7 @@ jobs:
|
||||||
apt-get install --no-install-recommends -qq -y git git-lfs
|
apt-get install --no-install-recommends -qq -y git git-lfs
|
||||||
rm /etc/apt/sources.list.d/testing.list
|
rm /etc/apt/sources.list.d/testing.list
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
- run: |
|
- uses: ./.forgejo/workflows/composite/build-backend
|
||||||
su forgejo -c 'make deps-backend'
|
|
||||||
- uses: actions/cache/restore@v4
|
|
||||||
id: cache-backend
|
|
||||||
with:
|
|
||||||
path: '/workspace/forgejo/forgejo/gitea'
|
|
||||||
key: backend-build-${{ github.sha }}
|
|
||||||
- if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
su forgejo -c 'make backend'
|
|
||||||
env:
|
|
||||||
TAGS: bindata sqlite sqlite_unlock_notify
|
|
||||||
- run: |
|
- run: |
|
||||||
su forgejo -c 'make test-sqlite-migration test-sqlite'
|
su forgejo -c 'make test-sqlite-migration test-sqlite'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
|
|
Loading…
Reference in a new issue