Skip to content

Commit 549a237

Browse files
committed
Publish source code in open source
1 parent 36d0930 commit 549a237

File tree

148 files changed

+28179
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+28179
-0
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Build"
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
GIT_CONFIG_GLOBAL: "/root/.gitconfig" # fix path in container (https://github.com/actions/runner/issues/2033)
8+
CI_BRANCH_NAME: "${{ github.head_ref != '' && github.head_ref || github.ref_name }}"
9+
10+
jobs:
11+
12+
### BINARY ###
13+
14+
binary:
15+
runs-on: "ubuntu-latest"
16+
container:
17+
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
18+
strategy:
19+
matrix:
20+
os_family: ["darwin", "linux"]
21+
architecture: ["arm64", "amd64"]
22+
steps:
23+
- uses: "actions/checkout@v4"
24+
with:
25+
fetch-depth: 50
26+
fetch-tags: true
27+
28+
- run: "make build/binary os_family=${{ matrix.os_family }} architecture=${{ matrix.architecture }}"
29+
30+
- name: "Upload binary artifacts"
31+
uses: "actions/upload-artifact@v4"
32+
with:
33+
name: "sdvg-${{ matrix.os_family }}-${{ matrix.architecture }}"
34+
path: "build/out/*"
35+
36+
### DOCKER ###
37+
38+
docker:
39+
runs-on: "ubuntu-latest"
40+
container:
41+
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
42+
strategy:
43+
matrix:
44+
os_family: ["linux"]
45+
architecture: ["amd64", "arm64"]
46+
steps:
47+
- uses: "actions/checkout@v4"
48+
with:
49+
fetch-depth: 50
50+
fetch-tags: true
51+
52+
- run: "make build/docker os_family=${{ matrix.os_family }} architecture=${{ matrix.architecture }}"
53+
54+
- name: "Upload binary artifacts"
55+
uses: "actions/upload-artifact@v4"
56+
with:
57+
name: "sdvg-${{ matrix.os_family }}-${{ matrix.architecture }}-image.tar.gz"
58+
path: "build/out/*"

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: "CI"
2+
run-name: |
3+
${{
4+
(github.event_name == 'pull_request' && format('Test PR "{0}"', github.event.pull_request.title)) ||
5+
(github.ref_name == github.event.repository.default_branch && 'Release') ||
6+
format('Test branch "{0}"', github.ref_name)
7+
}}
8+
9+
on:
10+
workflow_dispatch:
11+
pull_request:
12+
push:
13+
branches: ["master"]
14+
15+
jobs:
16+
create-semantic-tag:
17+
runs-on: "ubuntu-latest"
18+
outputs:
19+
RELEASE_VERSION: "${{ steps.create-tag.outputs.VERSION }}"
20+
steps:
21+
- uses: "actions/checkout@v4"
22+
23+
- name: "Create semantic tag"
24+
id: "create-tag"
25+
run: |
26+
if [ "${{ github.ref_name == github.event.repository.default_branch }}" != "true" ]; then
27+
echo "Skipping tagging because it's not the default branch"
28+
exit 0
29+
fi
30+
31+
VERSION=$(echo "${{ github.event.head_commit.message }}" \
32+
| sed -nE 's/.*[Rr]elease ([0-9]+\.[0-9]+\.[0-9]+).*?/\1/p')
33+
34+
if [ -z "${VERSION}" ]; then
35+
echo "No semantic version found in commit message"
36+
exit 0
37+
fi
38+
39+
echo "Adding semantic tag ${VERSION}..."
40+
git tag "${VERSION}"
41+
git push --tags
42+
echo "VERSION=${VERSION}" >> "${GITHUB_OUTPUT}"
43+
44+
test:
45+
needs: ["create-semantic-tag"]
46+
uses: "./.github/workflows/test.yml"
47+
48+
build:
49+
needs: ["test"]
50+
uses: "./.github/workflows/build.yml"
51+
52+
release-latest:
53+
if: "${{ github.ref_name == github.event.repository.default_branch }}"
54+
needs: ["build"]
55+
uses: "./.github/workflows/release.yml"
56+
with:
57+
release_name: "latest"
58+
59+
release-version:
60+
if: "${{ needs.create-semantic-tag.outputs.RELEASE_VERSION != '' }}"
61+
needs: ["create-semantic-tag", "build"]
62+
uses: "./.github/workflows/release.yml"
63+
with:
64+
release_name: "${{ needs.create-semantic-tag.outputs.RELEASE_VERSION }}"

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "Release"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release_name:
7+
type: "string"
8+
default: ""
9+
10+
jobs:
11+
release:
12+
runs-on: "ubuntu-latest"
13+
steps:
14+
- uses: "actions/checkout@v4"
15+
16+
- name: "Download build artifacts"
17+
uses: "actions/download-artifact@v4"
18+
with:
19+
path: "build/out/"
20+
pattern: "sdvg-*"
21+
merge-multiple: true
22+
23+
- name: "Extract release notes for ${{ inputs.release_name }}"
24+
env:
25+
RELEASE_NAME: "${{ inputs.release_name }}"
26+
run: 'awk "/^## .*$RELEASE_NAME/ { flag=1; next } /^## / { flag=0 } flag" CHANGELOG.md > release-notes.txt'
27+
28+
- name: "Remove old version of release"
29+
if: "${{ inputs.release_name == 'latest' }}"
30+
uses: "dev-drprasad/delete-tag-and-release@v1.1"
31+
with:
32+
tag_name: "${{ inputs.release_name }}"
33+
github_token: "${{ secrets.GITHUB_TOKEN }}"
34+
35+
- name: "Create release"
36+
uses: "ncipollo/release-action@v1"
37+
with:
38+
tag: "${{ inputs.release_name }}"
39+
bodyFile: "release-notes.txt"
40+
artifacts: "build/out/sdvg-*"
41+
draft: false
42+
prerelease: false
43+
makeLatest: "${{ inputs.release_name == 'latest' }}"
44+
env:
45+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/test.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "Test"
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
GIT_CONFIG_GLOBAL: "/root/.gitconfig" # fix path in container (https://github.com/actions/runner/issues/2033)
8+
9+
jobs:
10+
11+
### LINT ###
12+
13+
lint:
14+
runs-on: "ubuntu-latest"
15+
container:
16+
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
17+
steps:
18+
- uses: "actions/checkout@v4"
19+
20+
- name: "Run linter"
21+
run: "golangci-lint run --print-issued-lines=false --out-format code-climate:lint.json,line-number --timeout 5m"
22+
23+
- uses: "actions/upload-artifact@v4"
24+
with:
25+
name: "codequality"
26+
path: "lint.json"
27+
28+
### UNIT ###
29+
30+
unit:
31+
runs-on: "ubuntu-latest"
32+
container:
33+
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
34+
steps:
35+
- uses: "actions/checkout@v4"
36+
37+
- name: "Run unit tests"
38+
run: "make test/unit"
39+
40+
### COVER ###
41+
42+
cover:
43+
runs-on: "ubuntu-latest"
44+
container:
45+
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
46+
steps:
47+
- uses: "actions/checkout@v4"
48+
49+
- name: "Measuring test coverage"
50+
run: "make test/cover"
51+
52+
### PERFORMANCE ###
53+
54+
performance:
55+
runs-on: "ubuntu-latest"
56+
container:
57+
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
58+
steps:
59+
- uses: "actions/checkout@v4"
60+
61+
- name: "Run benchmarks"
62+
run: "make test/performance | tee performance.out"

.gitignore

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
### Project specific
2+
3+
build/out/
4+
output/
5+
!internal/generator/output
6+
*.log
7+
*.csv
8+
*.parquet
9+
*.sql
10+
lint.json
11+
performance*.txt
12+
coverage*.html
13+
profile
14+
*.prof
15+
config/*
16+
!config/config.yml
17+
!config/models.yml
18+
19+
### Go template
20+
21+
# Binaries for programs and plugins
22+
*.exe
23+
*.exe~
24+
*.dll
25+
*.so
26+
*.dylib
27+
28+
# Test binary, built with `go test -c`
29+
*.test
30+
31+
# Output of the go coverage tool, specifically when used with LiteIDE
32+
*.out
33+
34+
# Dependency directories (remove the comment below to include it)
35+
vendor/
36+
37+
# Go workspace file
38+
go.work
39+
40+
### JetBrains
41+
42+
# User-specific stuff
43+
.idea/
44+
45+
# Gradle and Maven with auto-import
46+
# When using Gradle or Maven with auto-import, you should exclude module files,
47+
# since they will be recreated, and may cause churn. Uncomment if using
48+
# auto-import.
49+
*.iml
50+
*.ipr
51+
52+
# CMake
53+
cmake-build-*/
54+
55+
# File-based project format
56+
*.iws
57+
58+
# IntelliJ
59+
out/
60+
61+
# mpeltonen/sbt-idea plugin
62+
.idea_modules/
63+
64+
# JIRA plugin
65+
atlassian-ide-plugin.xml
66+
67+
# Crashlytics plugin (for Android Studio and IntelliJ)
68+
com_crashlytics_export_strings.xml
69+
crashlytics.properties
70+
crashlytics-build.properties
71+
fabric.properties
72+
73+
### Linux
74+
75+
# General
76+
*~
77+
78+
# temporary files which can be created if a process still has a handle open of a deleted file
79+
.fuse_hidden*
80+
81+
# KDE directory preferences
82+
.directory
83+
84+
# Linux trash folder which might appear on any partition or disk
85+
.Trash-*
86+
87+
# .nfs files are created when an open file is removed but is still being accessed
88+
.nfs*
89+
90+
### macOS
91+
92+
# General
93+
.DS_Store
94+
.AppleDouble
95+
.LSOverride
96+
97+
# Icon must end with two \r
98+
Icon
99+
100+
# Thumbnails
101+
._*
102+
103+
# Files that might appear in the root of a volume
104+
.DocumentRevisions-V100
105+
.fseventsd
106+
.Spotlight-V100
107+
.TemporaryItems
108+
.Trashes
109+
.VolumeIcon.icns
110+
.com.apple.timemachine.donotpresent
111+
112+
# Directories potentially created on remote AFP share
113+
.AppleDB
114+
.AppleDesktop
115+
Network Trash Folder
116+
Temporary Items
117+
.apdisk

0 commit comments

Comments
 (0)