Use image-only Gitea workflows
This commit is contained in:
parent
3abece6f4b
commit
f807cdd075
@ -13,7 +13,20 @@ jobs:
|
|||||||
image: golang:1.24-bookworm
|
image: golang:1.24-bookworm
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
git init .
|
||||||
|
if [ -n "${TOKEN:-}" ]; then
|
||||||
|
server="${GITHUB_SERVER_URL#https://}"
|
||||||
|
server="${server#http://}"
|
||||||
|
git remote add origin "https://x-access-token:${TOKEN}@${server}/${GITHUB_REPOSITORY}.git"
|
||||||
|
else
|
||||||
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
fi
|
||||||
|
git fetch --depth=1 origin "${GITHUB_SHA}"
|
||||||
|
git checkout --detach FETCH_HEAD
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -6,14 +6,27 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-push:
|
lint-test:
|
||||||
name: Test, build, and push image
|
name: Lint and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.24-bookworm
|
image: golang:1.24-bookworm
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
git init .
|
||||||
|
if [ -n "${TOKEN:-}" ]; then
|
||||||
|
server="${GITHUB_SERVER_URL#https://}"
|
||||||
|
server="${server#http://}"
|
||||||
|
git remote add origin "https://x-access-token:${TOKEN}@${server}/${GITHUB_REPOSITORY}.git"
|
||||||
|
else
|
||||||
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
fi
|
||||||
|
git fetch --depth=1 origin "${GITHUB_SHA}"
|
||||||
|
git checkout --detach FETCH_HEAD
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: |
|
run: |
|
||||||
@ -30,6 +43,29 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: go test ./...
|
run: go test ./...
|
||||||
|
|
||||||
|
build-push:
|
||||||
|
name: Build and push image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: lint-test
|
||||||
|
container:
|
||||||
|
image: docker:27-git
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
git init .
|
||||||
|
if [ -n "${TOKEN:-}" ]; then
|
||||||
|
server="${GITHUB_SERVER_URL#https://}"
|
||||||
|
server="${server#http://}"
|
||||||
|
git remote add origin "https://x-access-token:${TOKEN}@${server}/${GITHUB_REPOSITORY}.git"
|
||||||
|
else
|
||||||
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
fi
|
||||||
|
git fetch --depth=1 origin "${GITHUB_SHA}"
|
||||||
|
git checkout --detach FETCH_HEAD
|
||||||
|
|
||||||
- name: Read version
|
- name: Read version
|
||||||
run: |
|
run: |
|
||||||
version="$(tr -d '[:space:]' < VERSION)"
|
version="$(tr -d '[:space:]' < VERSION)"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user