Skip to content

Commit 00a58bf

Browse files
committed
Initial release
0 parents  commit 00a58bf

File tree

173 files changed

+50840
-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.

173 files changed

+50840
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": ["babel-plugin-transform-import-meta"]
4+
}

.clang-format

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: false
7+
AlignConsecutiveAssignments: false
8+
AlignConsecutiveBitFields: false
9+
AlignConsecutiveDeclarations: false
10+
AlignEscapedNewlines: Right
11+
AlignOperands: Align
12+
AlignTrailingComments: true
13+
AllowAllArgumentsOnNextLine: true
14+
AllowAllConstructorInitializersOnNextLine: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortEnumsOnASingleLine: true
17+
AllowShortBlocksOnASingleLine: Never
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: All
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLoopsOnASingleLine: false
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: MultiLine
27+
BinPackArguments: true
28+
BinPackParameters: true
29+
BraceWrapping:
30+
AfterCaseLabel: false
31+
AfterClass: false
32+
AfterControlStatement: Never
33+
AfterEnum: false
34+
AfterFunction: false
35+
AfterNamespace: false
36+
AfterObjCDeclaration: false
37+
AfterStruct: false
38+
AfterUnion: false
39+
AfterExternBlock: false
40+
BeforeCatch: false
41+
BeforeElse: false
42+
BeforeLambdaBody: false
43+
BeforeWhile: false
44+
IndentBraces: false
45+
SplitEmptyFunction: true
46+
SplitEmptyRecord: true
47+
SplitEmptyNamespace: true
48+
BreakBeforeBinaryOperators: None
49+
BreakBeforeBraces: Attach
50+
BreakBeforeInheritanceComma: false
51+
BreakInheritanceList: BeforeColon
52+
BreakBeforeTernaryOperators: true
53+
BreakConstructorInitializersBeforeComma: false
54+
BreakConstructorInitializers: BeforeColon
55+
BreakAfterJavaFieldAnnotations: false
56+
BreakStringLiterals: true
57+
ColumnLimit: 100
58+
CommentPragmas: '^ IWYU pragma:'
59+
CompactNamespaces: false
60+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
61+
ConstructorInitializerIndentWidth: 4
62+
ContinuationIndentWidth: 4
63+
Cpp11BracedListStyle: true
64+
DeriveLineEnding: true
65+
DerivePointerAlignment: false
66+
DisableFormat: false
67+
ExperimentalAutoDetectBinPacking: false
68+
FixNamespaceComments: true
69+
ForEachMacros:
70+
- foreach
71+
- Q_FOREACH
72+
- BOOST_FOREACH
73+
IncludeBlocks: Preserve
74+
IncludeCategories:
75+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
76+
Priority: 2
77+
SortPriority: 0
78+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
79+
Priority: 3
80+
SortPriority: 0
81+
- Regex: '.*'
82+
Priority: 1
83+
SortPriority: 0
84+
IncludeIsMainRegex: '(Test)?$'
85+
IncludeIsMainSourceRegex: ''
86+
IndentCaseLabels: false
87+
IndentCaseBlocks: false
88+
IndentGotoLabels: true
89+
IndentPPDirectives: None
90+
IndentExternBlock: AfterExternBlock
91+
IndentWidth: 2
92+
IndentWrappedFunctionNames: false
93+
InsertTrailingCommas: None
94+
JavaScriptQuotes: Leave
95+
JavaScriptWrapImports: true
96+
KeepEmptyLinesAtTheStartOfBlocks: true
97+
MacroBlockBegin: ''
98+
MacroBlockEnd: ''
99+
MaxEmptyLinesToKeep: 1
100+
NamespaceIndentation: None
101+
ObjCBinPackProtocolList: Auto
102+
ObjCBlockIndentWidth: 2
103+
ObjCBreakBeforeNestedBlockParam: true
104+
ObjCSpaceAfterProperty: false
105+
ObjCSpaceBeforeProtocolList: true
106+
PenaltyBreakAssignment: 2
107+
PenaltyBreakBeforeFirstCallParameter: 19
108+
PenaltyBreakComment: 300
109+
PenaltyBreakFirstLessLess: 120
110+
PenaltyBreakString: 1000
111+
PenaltyBreakTemplateDeclaration: 10
112+
PenaltyExcessCharacter: 1000000
113+
PenaltyReturnTypeOnItsOwnLine: 60
114+
PointerAlignment: Right
115+
ReflowComments: true
116+
SortIncludes: true
117+
SortUsingDeclarations: true
118+
SpaceAfterCStyleCast: false
119+
SpaceAfterLogicalNot: false
120+
SpaceAfterTemplateKeyword: true
121+
SpaceBeforeAssignmentOperators: true
122+
SpaceBeforeCpp11BracedList: false
123+
SpaceBeforeCtorInitializerColon: true
124+
SpaceBeforeInheritanceColon: true
125+
SpaceBeforeParens: ControlStatements
126+
SpaceBeforeRangeBasedForLoopColon: true
127+
SpaceInEmptyBlock: false
128+
SpaceInEmptyParentheses: false
129+
SpacesBeforeTrailingComments: 1
130+
SpacesInAngles: false
131+
SpacesInConditionalStatement: false
132+
SpacesInContainerLiterals: true
133+
SpacesInCStyleCastParentheses: false
134+
SpacesInParentheses: false
135+
SpacesInSquareBrackets: false
136+
SpaceBeforeSquareBrackets: false
137+
Standard: Latest
138+
StatementMacros:
139+
- Q_UNUSED
140+
- QT_REQUIRE_VERSION
141+
TabWidth: 8
142+
UseCRLF: false
143+
UseTab: Never
144+
WhitespaceSensitiveMacros:
145+
- STRINGIZE
146+
- PP_STRINGIZE
147+
- BOOST_PP_STRINGIZE
148+
...
149+

.eslintrc.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: './config/eslint/repo/.eslintrc.cjs',
3+
};

.github/workflows/build-libs.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build /libs directory
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
VAULT_TOKEN:
7+
required: true
8+
9+
jobs:
10+
build_fastedge_libs:
11+
runs-on: [self-hosted, ubuntu-22-04, regular]
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up repo submodules
17+
run: git submodule update --init --recursive
18+
19+
- name: Setup Node.js latest
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20.x
23+
24+
- name: Install dependencies
25+
run: |
26+
npm ci
27+
28+
- name: Import Secrets
29+
uses: hashicorp/vault-action@v3
30+
id: secrets
31+
with:
32+
url: https://puppet-vault.gc.onl
33+
token: ${{ secrets.VAULT_TOKEN }}
34+
secrets: |
35+
secret/project_fastedge/harbor-robot-account password | HARBOR_PASSWORD ;
36+
secret/project_fastedge/harbor-robot-account username | HARBOR_LOGIN ;
37+
38+
- name: Login to Harbor
39+
uses: docker/login-action@v3
40+
with:
41+
registry: harbor.p.gc.onl
42+
username: ${{ steps.secrets.outputs.HARBOR_LOGIN }}
43+
password: ${{ steps.secrets.outputs.HARBOR_PASSWORD }}
44+
45+
- name: display contents of lib folder
46+
run: ls -la lib
47+
48+
- name: Ensure build folders are empty # Should already be empty
49+
run: |
50+
rm -rf lib/*
51+
rm -rf bin/*
52+
53+
- name: Build docker images
54+
run: docker build -t clang-monkey .
55+
56+
- name: Build FastEdge runtime libs
57+
run: docker run -v $(pwd)/lib:/usr/src/app/lib clang-monkey
58+
59+
- name: Build Javascript libs
60+
run: npm run build:js
61+
62+
- name: Run Integration Tests
63+
run: npm run test:integration
64+
65+
- name: Upload libs Artifact
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: libs-artifact
69+
retention-days: 1
70+
path: |
71+
bin/
72+
lib/
73+
types/
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Code Validation
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
code_validation:
8+
runs-on: [self-hosted, ubuntu-22-04, regular]
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Setup Node.js latest
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20.x
17+
18+
- name: Install dependencies
19+
run: |
20+
npm ci
21+
22+
- name: ESlint
23+
run: |
24+
npm run lint
25+
26+
- name: File naming convention
27+
run: |
28+
./scripts/filename-validation.sh

.github/workflows/deploy.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy to NPM
2+
3+
on:
4+
push:
5+
# If you add a branch here, you **MUST** create a branch rule in Github settings
6+
branches: ['*.*.x', '*.x', 'main', 'next', 'next-major', 'beta', 'alpha']
7+
paths:
8+
- 'src/**'
9+
- 'runtime/**'
10+
11+
workflow_dispatch: # trigger manually
12+
inputs:
13+
dry_run:
14+
description: 'NPM release dry-run'
15+
required: true
16+
default: 'true'
17+
18+
jobs:
19+
# Gihub Actions do not allow regex validation for numbers in *.*.x branch names
20+
validate_branch_name:
21+
runs-on: [self-hosted, ubuntu-22-04, regular]
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Validate branch name
27+
run: |
28+
branch_name=$(echo $GITHUB_REF | cut -d'/' -f3)
29+
if [[ $branch_name =~ ^[0-9]+(\.[0-9]+)?\.x$ ]] || [[ $branch_name == "main" ]] || [[ $branch_name == "next" ]] || [[ $branch_name == "next-major" ]] || [[ $branch_name == "beta" ]] || [[ $branch_name == "alpha" ]]; then
30+
echo "Branch name is valid"
31+
else
32+
echo "Branch name is invalid"
33+
exit 1
34+
fi
35+
36+
code_validation:
37+
needs: [validate_branch_name]
38+
uses: ./.github/workflows/code-validation.yaml
39+
40+
unit_tests:
41+
needs: [validate_branch_name]
42+
uses: ./.github/workflows/unit-tests.yaml
43+
44+
build_fastedge_artifacts:
45+
needs: [code_validation, unit_tests]
46+
uses: ./.github/workflows/build-libs.yaml
47+
secrets:
48+
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
49+
50+
npm_release:
51+
needs: [build_fastedge_artifacts]
52+
uses: ./.github/workflows/release.yaml
53+
with:
54+
dry_run: ${{ github.event.inputs.dry_run || 'true' }}
55+
secrets:
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/docs.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy Docs to Github Pages
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
paths:
7+
- 'docs/**'
8+
9+
workflow_dispatch: # trigger manually
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: 'pages'
18+
cancel-in-progress: false
19+
20+
env:
21+
BUILD_PATH: './docs'
22+
23+
jobs:
24+
build:
25+
name: Build Static Docs
26+
runs-on: [self-hosted, ubuntu-22-04, regular]
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 20.x
35+
36+
- name: Setup Pages
37+
id: pages
38+
uses: actions/configure-pages@v5
39+
40+
- name: Install dependencies
41+
run: npm ci
42+
working-directory: ${{ env.BUILD_PATH }}
43+
44+
- name: Vars
45+
run: |
46+
echo "astro origin=${{ steps.pages.outputs.origin }}"
47+
echo "astro base_path=${{ steps.pages.outputs.base_path }}"
48+
49+
- name: Build with Astro
50+
run: |
51+
npm run build -- \
52+
--site "${{ steps.pages.outputs.origin }}" \
53+
--base "${{ steps.pages.outputs.base_path }}"
54+
working-directory: ${{ env.BUILD_PATH }}
55+
56+
- name: Upload artifact
57+
uses: actions/upload-pages-artifact@v3
58+
with:
59+
path: ${{ env.BUILD_PATH }}/dist
60+
61+
deploy:
62+
name: Deploy Static Docs
63+
needs: build
64+
runs-on: [self-hosted, ubuntu-22-04, regular]
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)