Skip to content

Commit ce07f63

Browse files
committed
- Checkpoint: Initial Code Checkin
1 parent 17f6d15 commit ce07f63

24 files changed

+1889
-1
lines changed

.github/workflows/Master-Build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: master-build
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v3
16+
with:
17+
dotnet-version: 9.0.x
18+
- name: Restore dependencies
19+
run: dotnet restore
20+
- name: Build
21+
run: dotnet build --no-restore
22+
- name: Test
23+
run: dotnet test --no-build --verbosity normal
24+
25+
run-Lint:
26+
runs-on: ubuntu-latest
27+
env:
28+
github-token: '${{ secrets.GITHUB_TOKEN }}'
29+
steps:
30+
- name: Step-01 Checkout code
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 0
34+
- name: Step-02 Lint Code Base
35+
uses: github/super-linter@v4
36+
env:
37+
VALIDATE_ALL_CODEBASE: false
38+
FILTER_REGEX_INCLUDE: .*src/.*
39+
DEFAULT_BRANCH: master
40+
GITHUB_TOKEN: '${{ env.github-token }}'
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "master-codeql"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
paths-ignore:
18+
- "**/*.md"
19+
- "**/*.gitignore"
20+
- "**/*.gitattributes"
21+
schedule:
22+
- cron: '42 7 * * 5'
23+
24+
jobs:
25+
analyze:
26+
name: Analyze (${{ matrix.language }})
27+
# Runner size impacts CodeQL analysis time. To learn more, please see:
28+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
29+
# - https://gh.io/supported-runners-and-hardware-resources
30+
# - https://gh.io/using-larger-runners (GitHub.com only)
31+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
32+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
33+
permissions:
34+
# required for all workflows
35+
security-events: write
36+
37+
# required to fetch internal or private CodeQL packs
38+
packages: read
39+
40+
# only required for workflows in private repositories
41+
actions: read
42+
contents: read
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- language: actions
49+
build-mode: none
50+
- language: csharp
51+
build-mode: none
52+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
53+
# Use `c-cpp` to analyze code written in C, C++ or both
54+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
55+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
56+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
57+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
58+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
59+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
64+
# Add any setup steps before running the `github/codeql-action/init` action.
65+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
66+
# or others). This is typically only required for manual builds.
67+
# - name: Setup runtime (example)
68+
# uses: actions/setup-example@v1
69+
70+
# Initializes the CodeQL tools for scanning.
71+
- name: Initialize CodeQL
72+
uses: github/codeql-action/init@v3
73+
with:
74+
languages: ${{ matrix.language }}
75+
build-mode: ${{ matrix.build-mode }}
76+
# If you wish to specify custom queries, you can do so here or in a config file.
77+
# By default, queries listed here will override any specified in a config file.
78+
# Prefix the list here with "+" to use these queries and those in the config file.
79+
80+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
81+
# queries: security-extended,security-and-quality
82+
83+
# If the analyze step fails for one of the languages you are analyzing with
84+
# "We were unable to automatically build your code", modify the matrix above
85+
# to set the build mode to "manual" for that language. Then modify this step
86+
# to build your code.
87+
# ℹ️ Command-line programs to run using the OS shell.
88+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
89+
- if: matrix.build-mode == 'manual'
90+
shell: bash
91+
run: |
92+
echo 'If you are using a "manual" build mode for one or more of the' \
93+
'languages you are analyzing, replace this with the commands to build' \
94+
'your code, for example:'
95+
echo ' make bootstrap'
96+
echo ' make release'
97+
exit 1
98+
99+
- name: Perform CodeQL Analysis
100+
uses: github/codeql-action/analyze@v3
101+
with:
102+
category: "/language:${{matrix.language}}"

.github/workflows/PR-CI.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: pr-ci
2+
on:
3+
pull_request:
4+
types: [opened, reopened, edited, synchronize]
5+
paths-ignore:
6+
- "**/*.md"
7+
- "**/*.gitignore"
8+
- "**/*.gitattributes"
9+
jobs:
10+
Run-Lint:
11+
runs-on: ubuntu-latest
12+
env:
13+
github-token: '${{ secrets.GH_Packages }}'
14+
steps:
15+
- name: Step-01 Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Step-02 Lint Code Base
20+
uses: github/super-linter@v4
21+
env:
22+
VALIDATE_ALL_CODEBASE: false
23+
FILTER_REGEX_INCLUDE: .*src/.*
24+
DEFAULT_BRANCH: master
25+
GITHUB_TOKEN: '${{ env.github-token }}'
26+
Build-Test:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
release_Version: ${{ steps.gitversion.outputs.MajorMinorPatch }}
30+
beta_Version: ${{ steps.gitversion.outputs.nuGetVersion }}
31+
branchName: ${{ steps.gitversion.outputs.branchName }}
32+
env:
33+
working-directory: /home/runner/work/JSONPredicate/JSONPredicate
34+
35+
steps:
36+
- name: Step-01 Install GitVersion
37+
uses: gittools/actions/gitversion/setup@v0.9.7
38+
with:
39+
versionSpec: 5.x
40+
41+
- name: Step-02 Check out Code
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
46+
- name: Step-03 Calculate Version
47+
id: gitversion
48+
uses: gittools/actions/gitversion/execute@v0.9.7
49+
with:
50+
useConfigFile: true
51+
52+
- name: Step-04 Install .NET
53+
uses: actions/setup-dotnet@v3
54+
with:
55+
dotnet-version: 9.0.x
56+
57+
- name: Step-05 Restore dependencies
58+
run: dotnet restore
59+
working-directory: '${{ env.working-directory }}'
60+
61+
- name: Step-06 Build Version (Beta)
62+
if: ${{ !startsWith(github.head_ref, 'release/')}}
63+
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
64+
working-directory: '${{ env.working-directory }}'
65+
66+
- name: Step-06 Build Version (Release)
67+
if: ${{ startsWith(github.head_ref, 'release/')}}
68+
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
69+
working-directory: '${{ env.working-directory }}'
70+
71+
- name: Step-07 Test Solution
72+
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
73+
working-directory: '${{ env.working-directory }}'
74+
75+
- name: Step-08 Upload Build Artifacts
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: build-artifact
79+
path: ${{env.working-directory}}
80+
retention-days: 1
81+
82+
Package:
83+
needs: [Build-Test]
84+
runs-on: ubuntu-latest
85+
outputs:
86+
semVersion: ${{ needs.Build-Release.outputs.semVersion }}
87+
env:
88+
github-token: '${{ secrets.GH_Packages }}'
89+
nuget-token: '${{ secrets.NUGET_API_KEY }}'
90+
working-directory: /home/runner/work/JSONPredicate/JSONPredicate
91+
steps:
92+
- name: Step-01 Retrieve Build Artifacts
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: build-artifact
96+
path: ${{env.working-directory}}
97+
98+
- name: Step-02 Install Github Packages
99+
run: dotnet tool install gpr --global
100+
101+
- name: Step-03 Publish to Github Packages
102+
run: find -name "*.nupkg" -print -exec gpr push -k ${{env.github-token}} {} \;
103+
104+
Release:
105+
name: Release to Nuget
106+
needs: [Package]
107+
if: ${{ startsWith(github.head_ref, 'release/')}}
108+
runs-on: ubuntu-latest
109+
env:
110+
nuget-token: '${{ secrets.NUGET_API_KEY }}'
111+
working-directory: /home/runner/work/JSONPredicate/JSONPredicate
112+
steps:
113+
- name: Step-01 Retrieve Build Artifacts
114+
uses: actions/download-artifact@v4
115+
with:
116+
name: build-artifact
117+
path: ${{env.working-directory}}
118+
- name: Step-03 Release to Nuget Org
119+
if: ${{ startsWith(github.head_ref, 'release/')}}
120+
run: dotnet nuget push ${{env.working-directory}}/src/parsley/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json
121+

.github/workflows/PR-CodeQL.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "pr-codeql"
13+
14+
on:
15+
push:
16+
pull_request:
17+
types: [opened, reopened, edited, synchronize]
18+
paths-ignore:
19+
- "**/*.md"
20+
- "**/*.gitignore"
21+
- "**/*.gitattributes"
22+
schedule:
23+
- cron: '35 15 * * 2'
24+
25+
jobs:
26+
analyze:
27+
name: Analyze (${{ matrix.language }})
28+
# Runner size impacts CodeQL analysis time. To learn more, please see:
29+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
30+
# - https://gh.io/supported-runners-and-hardware-resources
31+
# - https://gh.io/using-larger-runners (GitHub.com only)
32+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
33+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
34+
permissions:
35+
# required for all workflows
36+
security-events: write
37+
38+
# required to fetch internal or private CodeQL packs
39+
packages: read
40+
41+
# only required for workflows in private repositories
42+
actions: read
43+
contents: read
44+
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
include:
49+
- language: actions
50+
build-mode: none
51+
- language: csharp
52+
build-mode: none
53+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
54+
# Use `c-cpp` to analyze code written in C, C++ or both
55+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
56+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
57+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
58+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
59+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
60+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v4
64+
65+
# Add any setup steps before running the `github/codeql-action/init` action.
66+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
67+
# or others). This is typically only required for manual builds.
68+
# - name: Setup runtime (example)
69+
# uses: actions/setup-example@v1
70+
71+
# Initializes the CodeQL tools for scanning.
72+
- name: Initialize CodeQL
73+
uses: github/codeql-action/init@v3
74+
with:
75+
languages: ${{ matrix.language }}
76+
build-mode: ${{ matrix.build-mode }}
77+
# If you wish to specify custom queries, you can do so here or in a config file.
78+
# By default, queries listed here will override any specified in a config file.
79+
# Prefix the list here with "+" to use these queries and those in the config file.
80+
81+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
82+
# queries: security-extended,security-and-quality
83+
84+
# If the analyze step fails for one of the languages you are analyzing with
85+
# "We were unable to automatically build your code", modify the matrix above
86+
# to set the build mode to "manual" for that language. Then modify this step
87+
# to build your code.
88+
# ℹ️ Command-line programs to run using the OS shell.
89+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
90+
- if: matrix.build-mode == 'manual'
91+
shell: bash
92+
run: |
93+
echo 'If you are using a "manual" build mode for one or more of the' \
94+
'languages you are analyzing, replace this with the commands to build' \
95+
'your code, for example:'
96+
echo ' make bootstrap'
97+
echo ' make release'
98+
exit 1
99+
100+
- name: Perform CodeQL Analysis
101+
uses: github/codeql-action/analyze@v3
102+
with:
103+
category: "/language:${{matrix.language}}"

GitVersion.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
next-version: 1.0.0
2+
tag-prefix: '[vV]'
3+
mode: ContinuousDeployment
4+
branches:
5+
master:
6+
regex: ^master$
7+
release:
8+
regex: ^release$
9+
develop:
10+
regex: ^develop$|^dev$
11+
tag: beta
12+
pull-request:
13+
tag: beta
14+
ignore:
15+
sha: []

Images/ninja-icon-16.png

15.3 KB
Loading

0 commit comments

Comments
 (0)