Switch CI/CD to Gitea Actions and Gitea registry
This commit is contained in:
47
.gitea/workflows/ci.yml
Normal file
47
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
ui:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
defaults:
|
||||
run:
|
||||
working-directory: control/ui
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: control/ui/package-lock.json
|
||||
|
||||
- run: npm config set registry https://registry.npmjs.org
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run typecheck
|
||||
- run: npm run test
|
||||
- run: npm run build
|
||||
|
||||
rust:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
defaults:
|
||||
run:
|
||||
working-directory: .
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy --workspace --all-targets -- -D warnings
|
||||
- run: cargo test --workspace
|
||||
40
.gitea/workflows/images.yml
Normal file
40
.gitea/workflows/images.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
env:
|
||||
REGISTRY: ${{ secrets.GITEA_REGISTRY_HOST }}
|
||||
USERNAME: ${{ secrets.GITEA_REGISTRY_USERNAME }}
|
||||
TOKEN: ${{ secrets.GITEA_REGISTRY_TOKEN }}
|
||||
run: |
|
||||
test -n "$REGISTRY"
|
||||
test -n "$USERNAME"
|
||||
test -n "$TOKEN"
|
||||
echo "$TOKEN" | docker login "$REGISTRY" -u "$USERNAME" --password-stdin
|
||||
|
||||
- name: Build images
|
||||
env:
|
||||
IMAGE_PREFIX: ${{ secrets.GITEA_IMAGE_PREFIX }}
|
||||
IMAGE_TAG: ${{ github.sha }}
|
||||
run: |
|
||||
test -n "$IMAGE_PREFIX"
|
||||
sh docker/scripts/build_images.sh all
|
||||
|
||||
- name: Push images
|
||||
env:
|
||||
IMAGE_PREFIX: ${{ secrets.GITEA_IMAGE_PREFIX }}
|
||||
IMAGE_TAG: ${{ github.sha }}
|
||||
run: |
|
||||
test -n "$IMAGE_PREFIX"
|
||||
sh docker/scripts/push_images.sh all
|
||||
Reference in New Issue
Block a user