Add GitHub Actions CI and ko/crane image release
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci / pre-commit (pull_request) Has been cancelled
ci / lint (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
ci / build (pull_request) Has been cancelled
ci / ui (pull_request) Has been cancelled
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci / pre-commit (pull_request) Has been cancelled
ci / lint (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
ci / build (pull_request) Has been cancelled
ci / ui (pull_request) Has been cancelled
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: iuclabs-k8s
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
- run: uvx pre-commit run --all-files --show-diff-on-failure
|
||||
|
||||
lint:
|
||||
runs-on: iuclabs-k8s
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: go vet ./...
|
||||
# existing findings predate this job; gate new code only
|
||||
- uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
|
||||
with:
|
||||
version: v2.15.0
|
||||
only-new-issues: true
|
||||
|
||||
test:
|
||||
runs-on: iuclabs-k8s
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
# runner image has no C toolchain (no -race) and no docker (testcontainers tests skip)
|
||||
- run: go test -count=1 ./pkg/... ./internal/...
|
||||
|
||||
build:
|
||||
runs-on: iuclabs-k8s
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: go build ./...
|
||||
- run: go install github.com/google/ko@v0.19.1
|
||||
- run: ko build --push=false --bare --platform linux/amd64 ./cmd/artifactapi
|
||||
env:
|
||||
KO_DOCKER_REPO: ghcr.io/iuclabs/artifactapi
|
||||
VERSION: dev
|
||||
|
||||
ui:
|
||||
runs-on: iuclabs-k8s
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ui
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: ui/package-lock.json
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
env:
|
||||
BASE_PATH: /ui
|
||||
@@ -0,0 +1,42 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: iuclabs-release
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: ui/package-lock.json
|
||||
- run: |
|
||||
go install github.com/google/ko@v0.19.1
|
||||
go install github.com/google/go-containerregistry/cmd/crane@v0.22.1
|
||||
- run: echo "${GITHUB_TOKEN}" | crane auth login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: API image
|
||||
run: ko build --bare --sbom=none --platform linux/amd64 --tags "${GITHUB_REF_NAME},latest" ./cmd/artifactapi
|
||||
env:
|
||||
KO_DOCKER_REPO: ghcr.io/iuclabs/artifactapi
|
||||
VERSION: ${{ github.ref_name }}
|
||||
- run: npm ci && npm run build
|
||||
working-directory: ui
|
||||
env:
|
||||
BASE_PATH: /ui
|
||||
- name: UI image
|
||||
run: scripts/ui-image.sh "ghcr.io/iuclabs/artifactapi-ui:${GITHUB_REF_NAME}" latest
|
||||
env:
|
||||
BASE_PATH: /ui
|
||||
Reference in New Issue
Block a user