Skip to content

Commit

Permalink
fix: pr and commit ci cannot run
Browse files Browse the repository at this point in the history
fix: pr and commit ci cannot run
  • Loading branch information
zzzhangqi authored Oct 31, 2024
2 parents 5df97b6 + 52aec57 commit 13f3eb3
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 341 deletions.
98 changes: 0 additions & 98 deletions .github/scripts/arch.sh

This file was deleted.

166 changes: 0 additions & 166 deletions .github/scripts/push-arch.sh

This file was deleted.

54 changes: 27 additions & 27 deletions .github/workflows/commit-ci-build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: commit-ci-build

on:
workflow_dispatch:
push:
branches: [main]

jobs:
build:
rainbond:
runs-on: ubuntu-latest
strategy:
matrix:
component: [api, chaos, worker, init-probe, mq]
steps:
- uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/setup-go@v2.1.3
with:
# The Go version to download (if necessary) and use. Supports semver spec and ranges.
go-version: 1.18
- name: Checkout repository
uses: actions/checkout@v3

# - name: SonarQube Scan
# uses: kitabisa/sonarqube-action@v1.1.0
# with:
# host: ${{ secrets.SONARQUBE_HOST }}
# login: ${{ secrets.SONARQUBE_TOKEN }}
# projectName: rainbond
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Set release description
run: |
buildTime=$(date +%F-%H)
git_commit=$(git log -n 1 --pretty --format=%h)
release_desc="dev-${git_commit}-${buildTime}"
echo "release_desc=$release_desc" >> $GITHUB_ENV
- name: Build the Docker image
env:
DISABLE_GOPROXY: true
DOMESTIC_BASE_NAME: registry.cn-hangzhou.aliyuncs.com
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOMESTIC_DOCKER_PASSWORD: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}
DOMESTIC_DOCKER_USERNAME: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
run: VERSION=${{ steps.extract_branch.outputs.branch }}-dev ./release.sh all push
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
build-args: |
RELEASE_DESC=${{ env.release_desc }}
context: .
file: hack/contrib/docker/${{ matrix.component }}/Dockerfile
push: false
tags: |
rainbond/rbd-${{ matrix.component }}:dev
49 changes: 25 additions & 24 deletions .github/workflows/pr-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,33 @@ on:
types: [opened, edited, synchronize, labeled, unlabeled]

jobs:
build:
rainbond:
runs-on: ubuntu-latest
strategy:
matrix:
component: [api, chaos, worker, init-probe, mq]
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Go environment
uses: actions/setup-go@v2.1.3
with:
# The Go version to download (if necessary) and use. Supports semver spec and ranges.
go-version: 1.18
- name: install-golint
run: |
git clone https://github.com/golang/lint.git
cd lint/golint
go install
- name: Go-linter
run: ./check.sh
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# - name: SonarQube Scan
# uses: kitabisa/sonarqube-action@v1.1.0
# with:
# host: ${{ secrets.SONARQUBE_HOST }}
# login: ${{ secrets.SONARQUBE_TOKEN }}
# projectName: rainbond
- name: Set release description
run: |
buildTime=$(date +%F-%H)
git_commit=$(git log -n 1 --pretty --format=%h)
release_desc="dev-${git_commit}-${buildTime}"
echo "release_desc=$release_desc" >> $GITHUB_ENV
- name: Build the Docker image
env:
DISABLE_GOPROXY: true
run: VERSION=${{ github.base_ref }}-dev ./release.sh all
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
build-args: |
RELEASE_DESC=${{ env.release_desc }}
context: .
file: hack/contrib/docker/${{ matrix.component }}/Dockerfile
push: false
tags: |
rainbond/rbd-${{ matrix.component }}:dev
Loading

0 comments on commit 13f3eb3

Please sign in to comment.