Skip to content

Commit

Permalink
Merge pull request #308 from taosdata/fix/ci
Browse files Browse the repository at this point in the history
ci: fix TDengine build
  • Loading branch information
huskar-t authored Nov 18, 2024
2 parents af6f514 + 5943352 commit 8f499a4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
run: sudo taosadapter &

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache-dependency-path: go.sum
Expand Down
54 changes: 40 additions & 14 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
- 'main'
- '3.0'
- '3.1'
push:
branches:
- 'main'
- '3.0'
- '3.1'

workflow_dispatch:
inputs:
tbBranch:
Expand All @@ -16,7 +22,7 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
name: Build
outputs:
commit_id: ${{ steps.get_commit_id.outputs.commit_id }}
Expand All @@ -29,6 +35,14 @@ jobs:
path: 'TDengine'
ref: ${{ github.base_ref }}

- name: checkout TDengine by push
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: ${{ github.ref_name }}

- name: checkout TDengine manually
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
Expand All @@ -52,6 +66,14 @@ jobs:
path: server.tar.gz
key: ${{ runner.os }}-build-${{ github.base_ref }}-${{ steps.get_commit_id.outputs.commit_id }}

- name: Cache server by push
if: github.event_name == 'push'
id: cache-server-push
uses: actions/cache@v4
with:
path: server.tar.gz
key: ${{ runner.os }}-build-${{ github.ref_name }}-${{ steps.get_commit_id.outputs.commit_id }}

- name: Cache server manually
if: github.event_name == 'workflow_dispatch'
id: cache-server-manually
Expand All @@ -60,27 +82,24 @@ jobs:
path: server.tar.gz
key: ${{ runner.os }}-build-${{ inputs.tbBranch }}-${{ steps.get_commit_id.outputs.commit_id }}

- name: prepare install
if: >
(github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') ||
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true')
run: sudo apt install -y libgeos-dev

- name: install TDengine
if: >
(github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') ||
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true')
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true') ||
(github.event_name == 'push' && steps.cache-server-push.outputs.cache-hit != 'true')
run: |
cd TDengine
mkdir debug
cd debug
cmake .. -DBUILD_TEST=off -DBUILD_HTTP=false -DBUILD_DEPENDENCY_TESTS=0 -DVERNUMBER=3.9.9.9 -DBUILD_DEPENDENCY_TESTS=0
cmake .. -DBUILD_TEST=off -DBUILD_HTTP=false -DBUILD_DEPENDENCY_TESTS=0 -DVERNUMBER=3.9.9.9
make -j 4
- name: package
if: >
(github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') ||
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true')
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true') ||
(github.event_name == 'push' && steps.cache-server-push.outputs.cache-hit != 'true')
run: |
mkdir -p ./release
cp ./TDengine/debug/build/bin/taos ./release/
Expand All @@ -107,7 +126,7 @@ jobs:
tar -zcvf server.tar.gz ./release
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
Expand All @@ -124,6 +143,16 @@ jobs:
restore-keys: |
${{ runner.os }}-build-${{ github.base_ref }}-
- name: get cache server by push
if: github.event_name == 'push'
id: get-cache-server-push
uses: actions/cache@v4
with:
path: server.tar.gz
key: ${{ runner.os }}-build-${{ github.ref_name }}-${{ needs.build.outputs.commit_id }}
restore-keys: |
${{ runner.os }}-build-${{ github.ref_name }}-
- name: cache server manually
if: github.event_name == 'workflow_dispatch'
id: get-cache-server-manually
Expand All @@ -134,8 +163,6 @@ jobs:
restore-keys: |
${{ runner.os }}-build-${{ inputs.tbBranch }}-
- name: prepare install
run: sudo apt install -y libgeos-dev
- name: install
run: |
Expand Down Expand Up @@ -164,7 +191,7 @@ jobs:
run: sudo taosadapter &

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache-dependency-path: go.sum
Expand All @@ -173,7 +200,6 @@ jobs:
run: sudo go test -v --count=1 -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage to Codecov
if: ${{ matrix.go == 'stable'}}
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
Expand Down
141 changes: 0 additions & 141 deletions .github/workflows/push.yml

This file was deleted.

0 comments on commit 8f499a4

Please sign in to comment.