forked from dmikushin/tray
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add unit testing and standardize to org
- Loading branch information
1 parent
4d8b798
commit 1eb06bc
Showing
33 changed files
with
1,342 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
# This file is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# Generated from CLion C/C++ Code Style settings | ||
BasedOnStyle: LLVM | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: DontAlign | ||
AlignConsecutiveAssignments: false | ||
AlignOperands: Align | ||
AllowAllArgumentsOnNextLine: false | ||
AllowAllConstructorInitializersOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Always | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: WithoutElse | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortLoopsOnASingleLine: true | ||
AlignTrailingComments: false | ||
AlwaysBreakAfterReturnType: All | ||
AlwaysBreakTemplateDeclarations: MultiLine | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterControlStatement: Never | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterObjCDeclaration: false | ||
AfterUnion: false | ||
BeforeCatch: true | ||
BeforeElse: true | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeTernaryOperators: false | ||
BreakConstructorInitializers: AfterColon | ||
BreakInheritanceList: AfterColon | ||
ColumnLimit: 0 | ||
CompactNamespaces: false | ||
ContinuationIndentWidth: 2 | ||
IndentCaseLabels: true | ||
IndentPPDirectives: BeforeHash | ||
IndentWidth: 2 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: All | ||
ObjCSpaceAfterProperty: true | ||
ObjCSpaceBeforeProtocolList: true | ||
PointerAlignment: Right | ||
ReflowComments: true | ||
SpaceAfterCStyleCast: true | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: true | ||
SpaceBeforeCtorInitializerColon: false | ||
SpaceBeforeInheritanceColon: false | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: Never | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
TabWidth: 2 | ||
Cpp11BracedListStyle: false | ||
UseTab: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[flake8] | ||
filename = | ||
*.py, | ||
*.pys | ||
max-line-length = 120 | ||
extend-exclude = | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:30" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "09:00" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "nuget" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "09:30" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "10:00" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "gitsubmodule" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "10:30" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# Configuration for Label Actions - https://github.com/dessant/label-actions | ||
|
||
added: | ||
comment: > | ||
This feature has been added and will be available in the next release. | ||
fixed: | ||
comment: > | ||
This issue has been fixed and will be available in the next release. | ||
invalid:duplicate: | ||
comment: > | ||
:wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue. | ||
close: true | ||
lock: true | ||
unlabel: 'status:awaiting-triage' | ||
|
||
-invalid:duplicate: | ||
reopen: true | ||
unlock: true | ||
|
||
invalid:support: | ||
comment: > | ||
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports. | ||
However, this issue appears to be a support request. Please use our | ||
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks. | ||
close: true | ||
lock: true | ||
lock-reason: 'off-topic' | ||
unlabel: 'status:awaiting-triage' | ||
|
||
-invalid:support: | ||
reopen: true | ||
unlock: true | ||
|
||
invalid:template-incomplete: | ||
issues: | ||
comment: > | ||
:wave: @{issue-author}, please edit your issue to complete the template with | ||
all the required info. Your issue will be automatically closed in 5 days if | ||
the template is not completed. Thanks. | ||
prs: | ||
comment: > | ||
:wave: @{issue-author}, please edit your PR to complete the template with | ||
all the required info. Your PR will be automatically closed in 5 days if | ||
the template is not completed. Thanks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# This workflow creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created | ||
# against the `master` (default) branch. | ||
|
||
name: Auto create PR | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'nightly' | ||
|
||
jobs: | ||
create_pr: | ||
if: startsWith(github.repository, 'LizardByte/') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create Pull Request | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
source_branch: "" # should be "nightly" as it's the triggering branch | ||
destination_branch: "master" | ||
pr_title: "Pulling ${{ github.ref_name }} into master" | ||
pr_template: ".github/pr_release_template.md" | ||
pr_assignee: "${{ secrets.GH_BOT_NAME }}" | ||
pr_draft: true | ||
pr_allow_empty: false | ||
github_token: ${{ secrets.GH_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs. | ||
|
||
name: Automerge PR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
autoapprove: | ||
if: >- | ||
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) && | ||
contains(fromJson('["LizardByte-bot"]'), github.actor) && | ||
startsWith(github.repository, 'LizardByte/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Autoapproving | ||
uses: hmarr/auto-approve-action@v3 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Label autoapproved | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GH_BOT_TOKEN }} | ||
script: | | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['autoapproved', 'autoupdate'] | ||
}) | ||
automerge: | ||
if: startsWith(github.repository, 'LizardByte/') | ||
needs: [autoapprove] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Automerging | ||
uses: pascalgn/[email protected] | ||
env: | ||
BASE_BRANCHES: nightly | ||
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }} | ||
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }} | ||
MERGE_LABELS: "!dependencies" | ||
MERGE_METHOD: "squash" | ||
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})" | ||
MERGE_DELETE_BRANCH: true | ||
MERGE_ERROR_FAIL: true | ||
MERGE_FILTER_AUTHOR: ${{ secrets.GH_BOT_NAME }} | ||
MERGE_RETRIES: "240" # 1 hour | ||
MERGE_RETRY_SLEEP: "15000" # 15 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
push: | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_win: | ||
name: Windows | ||
runs-on: windows-2019 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Dependencies Windows | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
update: true | ||
install: >- | ||
base-devel | ||
make | ||
mingw-w64-x86_64-binutils | ||
mingw-w64-x86_64-cmake | ||
mingw-w64-x86_64-toolchain | ||
- name: Setup python | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Python Path | ||
id: python-path | ||
shell: msys2 {0} | ||
run: | | ||
# replace backslashes with double backslashes | ||
python_path=$(echo "${{ steps.setup-python.outputs.python-path }}" | sed 's/\\/\\\\/g') | ||
# step output | ||
echo "python-path=${python_path}" | ||
echo "python-path=${python_path}" >> $GITHUB_OUTPUT | ||
- name: Build Windows | ||
shell: msys2 {0} | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake \ | ||
-G "MinGW Makefiles" \ | ||
.. | ||
mingw32-make -j$(nproc) | ||
- name: Run tests | ||
id: test | ||
shell: msys2 {0} | ||
working-directory: build/tests | ||
run: | | ||
./test_tray.exe --gtest_color=yes | ||
- name: Generate gcov report | ||
# any except canceled or skipped | ||
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') | ||
id: test_report | ||
shell: msys2 {0} | ||
working-directory: build | ||
run: | | ||
${{ steps.python-path.outputs.python-path }} -m pip install gcovr | ||
${{ steps.python-path.outputs.python-path }} -m gcovr -r .. \ | ||
--exclude ../tests/ \ | ||
--exclude ../third-party/ \ | ||
--xml-pretty \ | ||
-o coverage.xml | ||
- name: Upload coverage | ||
# any except canceled or skipped | ||
if: always() && (steps.test_report.outcome == 'success') | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./build/coverage.xml | ||
flags: ${{ runner.os }} | ||
token: ${{ secrets.CODECOV_TOKEN }} |
Oops, something went wrong.