Skip to content

Commit 21c2861

Browse files
db3fansimrtstore
and
imrtstore
authoredApr 30, 2022
feat:config the cicd flow of rtstore (dbpunk-labs#4)
* Create rust.yml * feat: first commit for rtstore * fix: remove some unused warning * fix: add cicd flow * fix: update cd.yml * fix: fix rustfmt not found error * fix: update coverage * fix: add cov token * fix: move bin to cmd * feat: add compute node , frontend node and memory node * fix: fix error from clippy check * fix: replace rtstore-tpl with rtstore Co-authored-by: imrtstore <rtstrore_dev@outlook.com>
1 parent 5d8f84d commit 21c2861

33 files changed

+721
-120
lines changed
 

‎.github/ISSUE_TEMPLATE/bug_report.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Bug description
11+
12+
<!-- A clear and concise description of what the bug is. -->
13+
14+
- Would you like to work on a fix? [y/n]
15+
16+
## To Reproduce
17+
18+
Steps to reproduce the behavior:
19+
20+
1. ...
21+
2. ...
22+
3. ...
23+
4. ...
24+
25+
<!-- Make sure you are able to reproduce the bug in the main branch, too. -->
26+
27+
## Expected behavior
28+
29+
<!-- A clear and concise description of what you expected to happen. -->
30+
31+
## Screenshots
32+
33+
<!-- If applicable, add screenshots to help explain your problem. -->
34+
35+
## Environment
36+
37+
<!-- Please fill the following information. -->
38+
39+
- OS: [e.g. Ubuntu 20.04]
40+
- rtstore-tpl version: [e.g. 0.1.0]
41+
42+
## Additional context
43+
44+
<!-- Add any other context about the problem here. -->

‎.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Motivations
11+
12+
<!--
13+
If your feature request is related to a problem, please describe it.
14+
-->
15+
16+
- Would you like to implement this feature? [y/n]
17+
18+
## Solution
19+
20+
<!-- Describe the solution you'd like. -->
21+
22+
## Alternatives
23+
24+
<!-- Describe any alternative solutions or features you've considered. -->
25+
26+
## Additional context
27+
28+
<!-- Add any other context or screenshots about the feature request here. -->

‎.github/PULL_REQUEST_TEMPLATE.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Please explain the changes you made -->
2+
3+
<!--
4+
Please, make sure:
5+
- you have read the contributing guidelines:
6+
https://github.com/imrtstore/rtstore-tpl/blob/main/docs/CONTRIBUTING.md
7+
- you have formatted the code using rustfmt:
8+
https://github.com/rust-lang/rustfmt
9+
- you have checked that all tests pass, by running `cargo test --all`
10+
- you have updated the changelog (if needed):
11+
https://github.com/imrtstore/rtstore-tpl/blob/main/CHANGELOG.md
12+
-->

‎.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
# Look for `Cargo.toml` and `Cargo.lock` in the root directory
5+
directory: "/"
6+
# Check for updates every Monday
7+
schedule:
8+
interval: "weekly"
9+
open-pull-requests-limit: 10
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
# Check for updates every Monday
13+
schedule:
14+
interval: "weekly"
15+
open-pull-requests-limit: 10

‎.github/labels.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
sql:
19+
- src/sql/*
20+
21+
fontend:
22+
- src/fontent/*
23+
24+
tablet:
25+
- src/tablet/*
26+
27+
development-process:
28+
- dev/**.*
29+
- .github/**.*
30+
- ci/**.*
31+
- .asf.yaml
32+
33+
documentation:
34+
- docs/**.*
35+
- README.md
36+
- ./**/README.md

‎.github/workflows/cd.yml

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: CD # Continuous Deployment
2+
3+
on:
4+
push:
5+
tags:
6+
- '[v]?[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
10+
publish:
11+
name: Publishing for ${{ matrix.job.os }}
12+
runs-on: ${{ matrix.job.os }}
13+
strategy:
14+
matrix:
15+
rust: [stable]
16+
job:
17+
- os: macos-latest
18+
os-name: macos
19+
target: x86_64-apple-darwin
20+
architecture: x86_64
21+
binary-postfix: ""
22+
use-cross: false
23+
- os: ubuntu-latest
24+
os-name: linux
25+
target: x86_64-unknown-linux-gnu
26+
architecture: x86_64
27+
binary-postfix: ""
28+
use-cross: false
29+
- os: windows-latest
30+
os-name: windows
31+
target: x86_64-pc-windows-msvc
32+
architecture: x86_64
33+
binary-postfix: ".exe"
34+
use-cross: false
35+
- os: ubuntu-latest
36+
os-name: linux
37+
target: aarch64-unknown-linux-gnu
38+
architecture: arm64
39+
binary-postfix: ""
40+
use-cross: true
41+
- os: ubuntu-latest
42+
os-name: linux
43+
target: i686-unknown-linux-gnu
44+
architecture: i686
45+
binary-postfix: ""
46+
use-cross: true
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v3
51+
- name: Install Rust toolchain
52+
uses: actions-rs/toolchain@v1
53+
with:
54+
toolchain: ${{ matrix.rust }}
55+
profile: minimal
56+
override: true
57+
- uses: Swatinem/rust-cache@v1
58+
- name: Cargo build
59+
uses: actions-rs/cargo@v1
60+
with:
61+
command: build
62+
use-cross: ${{ matrix.job.use-cross }}
63+
toolchain: ${{ matrix.rust }}
64+
args: --release --target ${{ matrix.job.target }}
65+
66+
- name: install strip command
67+
shell: bash
68+
run: |
69+
if [[ ${{ matrix.job.target }} == aarch64-unknown-linux-gnu ]]; then
70+
sudo apt update
71+
sudo apt-get install -y binutils-aarch64-linux-gnu
72+
fi
73+
- name: Packaging final binary
74+
shell: bash
75+
run: |
76+
cd target/${{ matrix.job.target }}/release
77+
78+
####### reduce binary size by removing debug symbols #######
79+
BINARY_NAME=rtstore-tpl${{ matrix.job.binary-postfix }}
80+
if [[ ${{ matrix.job.target }} == aarch64-unknown-linux-gnu ]]; then
81+
GCC_PREFIX="aarch64-linux-gnu-"
82+
else
83+
GCC_PREFIX=""
84+
fi
85+
"$GCC_PREFIX"strip $BINARY_NAME
86+
87+
########## create tar.gz ##########
88+
RELEASE_NAME=rtstore-tpl-${GITHUB_REF/refs\/tags\//}-${{ matrix.job.os-name }}-${{ matrix.job.architecture }}
89+
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
90+
91+
########## create sha256 ##########
92+
if [[ ${{ runner.os }} == 'Windows' ]]; then
93+
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
94+
else
95+
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
96+
fi
97+
- name: Releasing assets
98+
uses: softprops/action-gh-release@v1
99+
with:
100+
files: |
101+
target/${{ matrix.job.target }}/release/rtstore-tpl-*.tar.gz
102+
target/${{ matrix.job.target }}/release/rtstore-tpl-*.sha256
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
105+
106+
publish-cargo:
107+
name: Publishing to Cargo
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Checkout repository
111+
uses: actions/checkout@v3
112+
- uses: actions-rs/toolchain@v1
113+
with:
114+
toolchain: stable
115+
profile: minimal
116+
override: true
117+
- uses: Swatinem/rust-cache@v1
118+
- uses: actions-rs/cargo@v1
119+
with:
120+
command: publish
121+
args: --token ${{ secrets.CRATE_KEY}}

0 commit comments

Comments
 (0)
Please sign in to comment.