Skip to content

Commit

Permalink
Merge branch 'tencent-master' into issue-9353
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/backend/ci/core/auth/api-auth/src/main/kotlin/com/tencent/devops/auth/constant/AuthMessageCode.kt
#	support-files/i18n/auth/message_en_US.properties
#	support-files/i18n/auth/message_zh_CN.properties
#	support-files/sql/1001_ci_auth_ddl_mysql.sql
  • Loading branch information
fcfang123 committed Oct 23, 2023
2 parents d05a780 + 96504e0 commit b71f9be
Show file tree
Hide file tree
Showing 6,621 changed files with 121,826 additions and 698,483 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
48 changes: 31 additions & 17 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,39 @@ name: Agent CI

on:
push:
branches: [ master ]
paths:
- 'src/agent/**'
branches: [master]
paths:
- 'src/agent/**'
pull_request:
branches: [ master, release-* ]
paths:
- 'src/agent/**'
branches: [master, release-*]
paths:
- 'src/agent/**'
workflow_dispatch:
workflow_call:
inputs:
upload:
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest
name: Build agent
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.19.6
- uses: actions/checkout@v2
- run: make clean all
working-directory: src/agent/
- uses: actions/upload-artifact@v1
with:
name: agent
path: src/agent/bin/
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.6
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('src/agent/go.sum') }}
- run: make BUILD_OUT_TAG=out clean all
working-directory: src/agent/
- uses: actions/upload-artifact@v3
if: ${{ inputs.upload == 'true' }}
with:
name: agent
path: src/agent/bin/
92 changes: 69 additions & 23 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,97 @@ name: Backend CI
# events but only for the master branch
on:
push:
branches: [ master ]
branches: [master]
paths:
- 'src/backend/ci/**'
pull_request:
branches: [ master, release-* ]
branches: [master, release-*]
paths:
- 'src/backend/ci/**'
workflow_dispatch:
workflow_call:
inputs:
upload:
required: true
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
backend-jar:
name: Build backend -- JAR
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:8.0
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- uses: actions/checkout@v3
- name: init mysql
run: |
export MYSQL_PWD=root
for i in *.sql;do echo $i;mysql -h 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uroot < $i;done
working-directory: support-files/sql
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "8"
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-jar-${{ hashFiles('src/backend/ci/**/*.gradle.kts', 'src/backend/ci/**/gradle-wrapper.properties','src/backend/ci/buildSrc/**/Versions.kt') }}
- name: Gradle Build Backend Service
working-directory: src/backend/ci
run: |
./gradlew clean test build :core:worker:worker-agent:shadowJar \
-DmysqlURL=127.0.0.1:${{ job.services.mysql.ports['3306'] }} -DmysqlUser=root -DmysqlPasswd=root --no-daemon
- uses: actions/upload-artifact@v1
if: ${{ inputs.upload == 'true' }}
with:
name: backend-jar
path: src/backend/ci/release

# Steps represent a sequence of tasks that will be executed as part of the job
backend-docker:
name: Build backend -- Docker
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: init mysql
run: |
export MYSQL_PWD=root
for i in *.sql;do echo $i;mysql -h 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uroot < $i;done
working-directory: support-files/sql
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
- name: Cache Gradle
uses: actions/cache@v1
distribution: "temurin"
java-version: "8"
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle Build
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-docker-${{ hashFiles('src/backend/ci/**/*.gradle.kts', 'src/backend/ci/**/gradle-wrapper.properties','src/backend/ci/buildSrc/**/Versions.kt') }}
- name: Gradle Build Backend Service
working-directory: src/backend/ci
run: |
./gradlew test clean :boot-assembly:classes \
-DmysqlURL=127.0.0.1:${{ job.services.mysql.ports['3306'] }} -DmysqlUser=root -DmysqlPasswd=root
./gradlew clean test build :core:worker:worker-agent:shadowJar -Ddevops.assemblyMode=KUBERNETES \
-DmysqlURL=127.0.0.1:${{ job.services.mysql.ports['3306'] }} -DmysqlUser=root -DmysqlPasswd=root --no-daemon
- uses: actions/upload-artifact@v1
if: ${{ inputs.upload == 'true' }}
with:
name: backend-docker
path: src/backend/ci/release
43 changes: 0 additions & 43 deletions .github/workflows/backend_booster.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/backend_turbo.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/dailyCache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 每天定时生成缓存
name: Daily Cache
on:
schedule:
- cron: '0 17 * * *' # 每天 UTC 时间 17:00 (东八区1点) 执行
workflow_dispatch:

jobs:
frontend:
name: Build frontend
with:
upload: false
uses: ./.github/workflows/frontend.yml

agent:
name: Build agent
with:
upload: false
uses: ./.github/workflows/agent.yml

backend:
name: Build backend
with:
upload: false
secrets: inherit
uses: ./.github/workflows/backend.yml
58 changes: 32 additions & 26 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,41 @@ on:
push:
branches: [master]
paths:
- "src/frontend/**"
- "src/frontend/**"
pull_request:
branches: [master, release-*]
paths:
- "src/frontend/**"
- "src/frontend/**"
workflow_dispatch:
workflow_call:
inputs:
upload:
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest

frontend:
name: Build frontend
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install && yarn start && yarn public
working-directory: src/frontend
- uses: actions/upload-artifact@v1
with:
name: frontend
path: src/frontend/frontend/
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v3
id: yarn-cache
with:
path: src/frontend/**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('src/frontend/**/package.json') }}
- name: prefer offline
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --prefer-offline && yarn install
working-directory: src/frontend
- run: yarn public
working-directory: src/frontend
- uses: actions/upload-artifact@v3
if: ${{ inputs.upload == 'true' }}
with:
name: frontend
path: src/frontend/frontend/
Loading

0 comments on commit b71f9be

Please sign in to comment.