Skip to content

Commit d392950

Browse files
initial commit
1 parent 45ad68d commit d392950

129 files changed

Lines changed: 3409 additions & 2 deletions

File tree

Some content is hidden

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

.github/.DS_Store

6 KB
Binary file not shown.

.github/workflows/main.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Example how to run API tests before deployment
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/api/**'
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: 'ubuntu-latest'
13+
14+
steps:
15+
- name: Code checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Build Container Image
19+
uses: docker/build-push-action@v5.3.0
20+
with:
21+
push: false
22+
load: true
23+
tags: mynewapi:${{ github.sha }}
24+
file: ./src/api/Dockerfile
25+
26+
- name: Create Docker Network
27+
run: docker network create vnet
28+
29+
- name: Run API in docker
30+
run: |
31+
docker run -d \
32+
-p 8080:8080 \
33+
--name mynewapi \
34+
--network vnet \
35+
mynewapi:${{ github.sha }}
36+
37+
- name: Test API before release
38+
uses: testlemon/testlemon-github-action@v1
39+
with:
40+
input_dir: ./tests
41+
output_dir: ./output
42+
network: container:mynewapi
43+
args: |
44+
--collections ./src/tests/collection-4.json \
45+
--variables host=http://mynewapi:8080 \
46+
--output output/output.json
47+
48+
#- name: Build image and push
49+
# uses: docker/build-push-action@v5.3.0
50+
# with:
51+
# push: true
52+
# tags: |
53+
# index.docker.io/${{ vars.DOCKERUSERNAME }}/api:latest
54+
# file: ./src/api/Dockerfile
55+
56+
- name: Archive output results
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: Tests report
61+
path: ./output/

.github/workflows/pages.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- "main"
9+
paths:
10+
- "docs/**"
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Single deploy job since we're just deploying
29+
deploy:
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
- name: Install mkDocs
38+
run: pip install mkdocs
39+
- name: Build mkDocs
40+
run: |
41+
cd docs
42+
mkdocs build
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v5
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
# Upload entire repository
49+
path: 'docs/site/.'
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.github/workflows/xray-auto.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Xray automatic tests provisioning
2+
3+
on:
4+
#push:
5+
# paths:
6+
# - 'src/api/**'
7+
# branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: 'ubuntu-latest'
13+
14+
steps:
15+
- name: Code checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Run tests with auto provisioning
19+
run: |
20+
docker run --name testlemon itbusina/testlemon:latest -c "$(<./examples/xray/auto-xray-provisioning.yaml)" -o output.json -f xray
21+
docker cp testlemon:/app/output.json output.json
22+
docker rm testlemon
23+
24+
- name: Upload test results to Xray
25+
shell: pwsh
26+
run: |
27+
$client_id = "${{ secrets.XRAY_CLIENT_ID }}"
28+
$client_secret = "${{ secrets.XRAY_CLIENT_SECRET }}"
29+
$jira_base_url = "${{ secrets.XRAY_JIRA_BASE_URL }}"
30+
$test_results = Get-Content "output.json"
31+
./scripts/xray-cloud-import.ps1 -client_id $client_id -client_secret $client_secret -jira_base_url $jira_base_url -test_results $test_results
32+

.github/workflows/xray-manual.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Xray manual tests provisioning
2+
3+
on:
4+
#push:
5+
# paths:
6+
# - 'src/api/**'
7+
# branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: 'ubuntu-latest'
13+
14+
steps:
15+
- name: Code checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Run tests with manual provisioning
19+
run: |
20+
docker run --name testlemon itbusina/testlemon:latest -c "$(<./examples/xray/manual-xray-provisioning.yaml)" -o output.json -f xray
21+
docker cp testlemon:/app/output.json output.json
22+
docker rm testlemon
23+
24+
- name: Upload test results to Xray
25+
shell: pwsh
26+
run: |
27+
$client_id = "${{ secrets.XRAY_CLIENT_ID }}"
28+
$client_secret = "${{ secrets.XRAY_CLIENT_SECRET }}"
29+
$jira_base_url = "${{ secrets.XRAY_JIRA_BASE_URL }}"
30+
$test_results = Get-Content "output.json"
31+
./scripts/xray-cloud-import.ps1 -client_id $client_id -client_secret $client_secret -jira_base_url $jira_base_url -test_results $test_results
32+

README.md

Lines changed: 11 additions & 2 deletions

api.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5CB007D-E5DE-4247-80BB-7741E1BE64E3}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "src\api\api.csproj", "{27B08A92-6570-4097-8A80-26B5D3E0AC9A}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(SolutionProperties) = preSolution
16+
HideSolutionNode = FALSE
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{27B08A92-6570-4097-8A80-26B5D3E0AC9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{27B08A92-6570-4097-8A80-26B5D3E0AC9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{27B08A92-6570-4097-8A80-26B5D3E0AC9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{27B08A92-6570-4097-8A80-26B5D3E0AC9A}.Release|Any CPU.Build.0 = Release|Any CPU
23+
EndGlobalSection
24+
GlobalSection(NestedProjects) = preSolution
25+
{27B08A92-6570-4097-8A80-26B5D3E0AC9A} = {A5CB007D-E5DE-4247-80BB-7741E1BE64E3}
26+
EndGlobalSection
27+
EndGlobal

docs/docs/.DS_Store

6 KB
Binary file not shown.

docs/docs/css/extra.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.wy-nav-content {
2+
max-width: 100%;
3+
}
4+
5+
.rst-content pre code {
6+
white-space: break-spaces !important;
7+
}

docs/docs/images/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)