Skip to content

Commit d2d919c

Browse files
Performance badges (#2)
* Add documentation * Change doc style * add automatic deploy * now 1 job for docs deployment * fix language selector on GH Pages, add contributing instructions * remove an unused section in en version of readme * fixed margins in markdown files * add deploy-docs workflow to CI * Documentation hosting on Github Pages fixes (#13) * new styles; added clarifications to the developer guide regarding documentation. * check ci * change styles * remove debug comments * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * lol * lol * lol * lol * lol * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci * check ci --------- Co-authored-by: Vladimir Severov <hackallcode@users.noreply.github.com>
1 parent 30e6d42 commit d2d919c

33 files changed

Lines changed: 851 additions & 90 deletions

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
binary:
1515
runs-on: "ubuntu-latest"
1616
container:
17-
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
17+
image: "ghcr.io/hoodiehuuuuu/sdvg-ci:0.0.1"
1818
strategy:
1919
matrix:
2020
os_family: ["darwin", "linux"]
@@ -38,7 +38,7 @@ jobs:
3838
docker:
3939
runs-on: "ubuntu-latest"
4040
container:
41-
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
41+
image: "ghcr.io/hoodiehuuuuu/sdvg-ci:0.0.1"
4242
strategy:
4343
matrix:
4444
os_family: ["linux"]

.github/workflows/ci.yml

Lines changed: 57 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,64 @@ on:
1212
push:
1313
branches: ["master"]
1414

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')
15+
concurrency:
16+
group: "${{ github.workflow }}-${{ github.ref_name }}"
17+
cancel-in-progress: "${{ github.ref_name != github.event.repository.default_branch }}"
3318

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"
19+
jobs:
20+
# create-semantic-tag:
21+
# runs-on: "ubuntu-latest"
22+
# outputs:
23+
# RELEASE_VERSION: "${{ steps.create-tag.outputs.VERSION }}"
24+
# steps:
25+
# - uses: "actions/checkout@v4"
26+
#
27+
# - name: "Create semantic tag"
28+
# id: "create-tag"
29+
# run: |
30+
# if [ "${{ github.ref_name == github.event.repository.default_branch }}" != "true" ]; then
31+
# echo "Skipping tagging because it's not the default branch"
32+
# exit 0
33+
# fi
34+
#
35+
# VERSION=$(echo "${{ github.event.head_commit.message }}" \
36+
# | sed -nE 's/.*[Rr]elease ([0-9]+\.[0-9]+\.[0-9]+).*?/\1/p')
37+
#
38+
# if [ -z "${VERSION}" ]; then
39+
# echo "No semantic version found in commit message"
40+
# exit 0
41+
# fi
42+
#
43+
# echo "Adding semantic tag ${VERSION}..."
44+
# git tag "${VERSION}"
45+
# git push --tags
46+
# echo "VERSION=${VERSION}" >> "${GITHUB_OUTPUT}"
4747

48-
build:
49-
needs: ["test"]
50-
uses: "./.github/workflows/build.yml"
48+
# test:
49+
# needs: ["create-semantic-tag"]
50+
# uses: "./.github/workflows/test.yml"
5151

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"
52+
performance:
53+
uses: "./.github/workflows/performance.yml"
5854

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 }}"
55+
# build:
56+
# needs: ["test"]
57+
# uses: "./.github/workflows/build.yml"
58+
#
59+
# release-latest:
60+
# if: "${{ github.ref_name == github.event.repository.default_branch }}"
61+
# needs: ["build"]
62+
# uses: "./.github/workflows/release.yml"
63+
# with:
64+
# release_name: "latest"
65+
#
66+
# release-version:
67+
# if: "${{ needs.create-semantic-tag.outputs.RELEASE_VERSION != '' }}"
68+
# needs: ["create-semantic-tag", "build"]
69+
# uses: "./.github/workflows/release.yml"
70+
# with:
71+
# release_name: "${{ needs.create-semantic-tag.outputs.RELEASE_VERSION }}"
72+
#
73+
# deploy-docs:
74+
# needs: ["release-latest"]
75+
# uses: "./.github/workflows/doc.yml"

.github/workflows/doc.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Documentation"
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
deploy:
8+
permissions:
9+
pages: "write"
10+
id-token: "write"
11+
environment:
12+
name: "github-pages"
13+
url: ${{ steps.deployment.outputs.page_url }}
14+
runs-on: "ubuntu-latest"
15+
steps:
16+
- uses: "actions/checkout@v4"
17+
18+
- name: "Set up Python"
19+
uses: "actions/setup-python@v5"
20+
with:
21+
python-version: '3.x'
22+
23+
- name: "Install requirements"
24+
run: "make doc/prepare"
25+
26+
- name: "Build site"
27+
run: "make doc/build"
28+
29+
- name: "Upload artifact"
30+
uses: "actions/upload-pages-artifact@v3"
31+
with:
32+
path: "./site"
33+
34+
- name: "Deploy to GitHub Page"
35+
id: "deployment"
36+
uses: "actions/deploy-pages@v4"

.github/workflows/performance.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "Compare performance"
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+
### PERFORMANCE ###
12+
13+
compare-performance:
14+
if: ${{ github.event_name == 'pull_request' }}
15+
runs-on: "ubuntu-latest"
16+
container:
17+
image: "ghcr.io/hoodiehuuuuu/sdvg-ci:0.0.1"
18+
permissions:
19+
pull-requests: write
20+
packages: read
21+
22+
steps:
23+
- uses: "actions/checkout@v4"
24+
25+
- name: "Install requirements"
26+
run: "make bench/prepare"
27+
28+
- name: "Try fetch cached benchmark result from master branch"
29+
id: "cache-benchmark"
30+
uses: "actions/cache/restore@v4"
31+
with:
32+
key: "benchmark-master"
33+
path: "benchmark-master.txt"
34+
35+
- name: "Fetch master branch"
36+
if: ${{ steps.cache-benchmark.outputs.cache-hit != 'true' }}
37+
uses: "actions/checkout@v4"
38+
with:
39+
ref: ${{ github.event.repository.default_branch }}
40+
path: "master_branch"
41+
42+
- name: "Create master benchmark"
43+
if: ${{ steps.cache-benchmark.outputs.cache-hit != 'true' }}
44+
working-directory: "master_branch"
45+
run: make test/performance > ../benchmark-master.txt
46+
47+
- name: "Save benchmark-master.txt to cache"
48+
if: ${{ steps.cache-benchmark.outputs.cache-hit != 'true' }}
49+
uses: "actions/cache/save@v4"
50+
with:
51+
key: "benchmark-master"
52+
path: "benchmark-master.txt"
53+
54+
- name: "Run benchmarks on PR branch"
55+
run: make test/performance > benchmark-pr.txt
56+
57+
- name: "Compare results"
58+
run: make bench/compare > performance-report.md
59+
60+
- uses: "mshick/add-pr-comment@v2"
61+
with:
62+
message-path: "performance-report.md"
63+
64+
update-performance-cache:
65+
if: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
66+
runs-on: "ubuntu-latest"
67+
container:
68+
image: "ghcr.io/hoodiehuuuuu/sdvg-ci:0.0.1"
69+
70+
steps:
71+
- uses: "actions/checkout@v4"
72+
73+
- name: "Create master benchmark"
74+
if: ${{ steps.cache-benchmark.outputs.cache-hit != 'true' }}
75+
run: make test/performance > ./benchmark-master.txt
76+
77+
- name: "Save benchmark-master.txt to cache"
78+
if: ${{ steps.cache-benchmark.outputs.cache-hit != 'true' }}
79+
uses: "actions/cache/save@v4"
80+
with:
81+
key: "benchmark-master"
82+
path: "benchmark-master.txt"

.github/workflows/test.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: "Run unit tests"
3838
run: "make test/unit"
3939

40-
### COVER ###
40+
## COVER ###
4141

4242
cover:
4343
runs-on: "ubuntu-latest"
@@ -56,14 +56,3 @@ jobs:
5656
file: "coverage.out"
5757
format: "golang"
5858

59-
### PERFORMANCE ###
60-
61-
performance:
62-
runs-on: "ubuntu-latest"
63-
container:
64-
image: "ghcr.io/tarantool/sdvg-ci:0.0.1"
65-
steps:
66-
- uses: "actions/checkout@v4"
67-
68-
- name: "Run benchmarks"
69-
run: "make test/performance | tee performance.out"

.gitignore

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config/*
1616
!config/config.yml
1717
!config/models.yml
1818

19-
### Go template
19+
### Go
2020

2121
# Binaries for programs and plugins
2222
*.exe
@@ -37,6 +37,116 @@ vendor/
3737
# Go workspace file
3838
go.work
3939

40+
### Python
41+
42+
# Byte-compiled / optimized / DLL files
43+
__pycache__/
44+
*.py[cod]
45+
*$py.class
46+
47+
# Distribution / packaging
48+
.Python
49+
develop-eggs/
50+
dist/
51+
downloads/
52+
eggs/
53+
.eggs/
54+
lib/
55+
lib64/
56+
parts/
57+
sdist/
58+
var/
59+
wheels/
60+
share/python-wheels/
61+
*.egg-info/
62+
.installed.cfg
63+
*.egg
64+
MANIFEST
65+
66+
# Installer logs
67+
pip-log.txt
68+
pip-delete-this-directory.txt
69+
70+
# Translations
71+
*.mo
72+
*.pot
73+
74+
# IPython
75+
profile_default/
76+
ipython_config.py
77+
78+
# pyenv
79+
# For a library or package, you might want to ignore these files since the code is
80+
# intended to run in multiple environments; otherwise, check them in:
81+
.python-version
82+
83+
# pipenv
84+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
85+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
86+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
87+
# install all needed dependencies.
88+
Pipfile.lock
89+
90+
# poetry
91+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
92+
# This is especially recommended for binary packages to ensure reproducibility, and is more
93+
# commonly ignored for libraries.
94+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
95+
poetry.lock
96+
97+
# pdm
98+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
99+
pdm.lock
100+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
101+
# in version control.
102+
# https://pdm.fming.dev/#use-with-ide
103+
.pdm.toml
104+
105+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
106+
__pypackages__/
107+
108+
# Celery stuff
109+
celerybeat-schedule
110+
celerybeat.pid
111+
112+
# SageMath parsed files
113+
*.sage.py
114+
115+
# Environments
116+
.env
117+
.venv
118+
env/
119+
venv/
120+
ENV/
121+
env.bak/
122+
venv.bak/
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/
134+
135+
# pytype static type analyzer
136+
.pytype/
137+
138+
# Cython debug symbols
139+
cython_debug/
140+
141+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
142+
poetry.toml
143+
144+
# ruff
145+
.ruff_cache/
146+
147+
# LSP config files
148+
pyrightconfig.json
149+
40150
### VSCode
41151

42152
.vscode

0 commit comments

Comments
 (0)