Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate gh pages #99

Draft
wants to merge 65 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c82c0d1
my first workflow
mPokornyETM Nov 8, 2023
9e50630
echo
mPokornyETM Nov 8, 2023
aa34b2e
cmd
mPokornyETM Nov 8, 2023
c5765e4
e
mPokornyETM Nov 8, 2023
c46d446
docker
mPokornyETM Nov 24, 2023
dab31a9
an other try
mPokornyETM Nov 24, 2023
19d8718
on
mPokornyETM Nov 24, 2023
31cc816
uiserver
mPokornyETM Nov 24, 2023
58c4f2c
use my image
mPokornyETM Dec 12, 2023
7a2e82b
own image
mPokornyETM Dec 12, 2023
1f95b45
mpokornyetm
mPokornyETM Dec 12, 2023
c0c62ee
oa version
mPokornyETM Dec 12, 2023
8f6650c
WCCOActrl -versio
mPokornyETM Dec 12, 2023
07f0b45
root
mPokornyETM Dec 12, 2023
ce4b767
echo
mPokornyETM Dec 12, 2023
e6dd5a9
next try
mPokornyETM Dec 12, 2023
644b761
Prepare file structure and project
mPokornyETM Dec 13, 2023
25a287d
release
mPokornyETM Dec 13, 2023
a252515
mkdir
mPokornyETM Dec 13, 2023
3487dcb
foo
mPokornyETM Dec 13, 2023
004968c
echo
mPokornyETM Dec 13, 2023
ac7eec1
Register Ctrl TestFramework
mPokornyETM Dec 13, 2023
4439d6a
proj
mPokornyETM Dec 13, 2023
492a820
echos
mPokornyETM Dec 13, 2023
95e14ee
sudo
mPokornyETM Dec 13, 2023
1c9bf93
opt
mPokornyETM Dec 13, 2023
18e9733
no root
mPokornyETM Dec 13, 2023
c83241e
working dir
mPokornyETM Dec 13, 2023
01a42ec
cwd
mPokornyETM Dec 13, 2023
7232251
reg
mPokornyETM Dec 13, 2023
8c15b1e
2 slashes
mPokornyETM Dec 13, 2023
fd340f0
cat
mPokornyETM Dec 13, 2023
3955d39
WCCILpmon
mPokornyETM Dec 13, 2023
d47dd6c
ls -la
mPokornyETM Dec 13, 2023
8c492d3
help
mPokornyETM Dec 13, 2023
94c4c0b
Install doxygen
mPokornyETM Dec 13, 2023
7d51e35
Build help
mPokornyETM Dec 13, 2023
7136a24
qhelpgenerator
mPokornyETM Dec 13, 2023
3a40f3a
3.19.8
mPokornyETM Dec 13, 2023
4549281
escape
mPokornyETM Dec 13, 2023
a2f8333
jUnit
mPokornyETM Dec 13, 2023
7c61e2a
Publish wiki
mPokornyETM Dec 13, 2023
e7d8ab6
jUnit
mPokornyETM Dec 13, 2023
adf224a
WIKI_ACTION_TOKEN
mPokornyETM Dec 13, 2023
022f988
jUnit optional
mPokornyETM Dec 13, 2023
5cb3e07
wiki
mPokornyETM Dec 13, 2023
58a7162
actions-gh-pages
mPokornyETM Dec 13, 2023
2e3aae4
publish_dir
mPokornyETM Dec 13, 2023
93cae68
publish_dir public
mPokornyETM Dec 13, 2023
425ae1d
an echo
mPokornyETM Dec 13, 2023
103c3f7
clean up workflow
mPokornyETM Dec 13, 2023
39f53c4
The testcase Ctrlppcheck has no assertions in good case
mPokornyETM Dec 13, 2023
514f0ea
fix tests
mPokornyETM Dec 13, 2023
45af7a8
better wording
mPokornyETM Dec 13, 2023
a69c195
jUnit: fail_on_failure
mPokornyETM Dec 13, 2023
a9fb35a
Merge pull request #1 from mPokornyETM/tests-fix-fails
mPokornyETM Dec 13, 2023
a3d8f18
simulate publish GH pages
mPokornyETM Dec 17, 2023
6a0b4fd
sim
mPokornyETM Dec 17, 2023
3b5d51e
deploy-pages
mPokornyETM Dec 17, 2023
77ac2e4
gh-pages fix
mPokornyETM Dec 17, 2023
9c961e5
ubuntu-latest
mPokornyETM Dec 17, 2023
1553468
download-artifac
mPokornyETM Dec 17, 2023
9cdfe65
static pages
mPokornyETM Dec 17, 2023
9d5de28
todo
mPokornyETM Dec 17, 2023
9f101ea
workflow rules
mPokornyETM Dec 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 177 additions & 10 deletions .github/workflows/createBundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ name: CI

on:
push:
branches: [ "main", "release/*" ]
branches: [ "main", "release/*" , "feature/*"]
# tags: ["v*"]
pull_request:
branches: [ "main", "release/*" ]
release:
types: [published]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
Expand Down Expand Up @@ -155,23 +161,71 @@ jobs:
execute_process(COMMAND sccache --show-stats)
endif()

# no ctest tests for modified cppcheck, they were just thrown away
#- name: Test
# working-directory: ${{github.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}


- name: Upload ctrlppcheck
uses: actions/upload-artifact@v3
with:
name: ctrlppcheck
path: ${{github.workspace}}/build/${{ matrix.config.artifact }}

buildHelp:
name: Build help
runs-on: ubuntu-20.04
container:
image: mpokornyetm/winccoa:v3.19.8-full
options: --user root
credentials:
username: mpokornyetm
password: ${{ secrets.DOCKER_CONTAINER_REGISTRY_TOKEN }}
steps:
- name: Install doxygen
working-directory: /opt/WinCC_OA/3.19/bin/
run: |
apt-get update
apt-get --assume-yes install -f doxygen

- uses: actions/checkout@v1
- name: Register Project
working-directory: ${{github.workspace}}/WinCCOA_QualityChecks/
run: |
cwd=$(pwd)

mkdir -p $cwd/config
cd $cwd/config

echo "[general]
pvss_path = \"/opt/WinCC_OA/3.19\"
proj_path = \"$cwd\"
proj_version = \"3.19\"
langs = \"en_US.utf8\"
pmonPort = 5999
" > config

mkdir -p $cwd/log

/opt/WinCC_OA/3.19/bin/WCCILpmon -config $cwd/config/config -n -autofreg -status -log +stderr || true

- name: Generate help
working-directory: /opt/WinCC_OA/3.19/bin/
run: |
./WCCOActrl -proj WinCCOA_QualityChecks -n doxygen.ctl -log +stderr -lang en_US.utf8

- name: Upload html help
uses: actions/upload-artifact@v3
with:
name: html-help
path: ${{github.workspace}}/WinCCOA_QualityChecks/help/html/*

- name: Upload QT help
uses: actions/upload-artifact@v3
with:
name: qt-help
path: ${{github.workspace}}/WinCCOA_QualityChecks/help/html/index.qch

package:
name: Package project and binaries
runs-on: ubuntu-20.04
needs: build
needs: [build, buildHelp]

steps:
- uses: actions/checkout@v3
Expand All @@ -180,24 +234,116 @@ jobs:
run: |
mkdir -p ${{github.workspace}}/install/WinCCOA_QualityChecks/bin/ctrlppcheck
cp -rp ${{github.workspace}}/WinCCOA_QualityChecks/* ${{github.workspace}}/install/WinCCOA_QualityChecks/
mkdir -p ${{github.workspace}}/tests/WinCC_OA_Test/
cp -rp ${{github.workspace}}/WinCC_OA_Test/* ${{github.workspace}}/tests/WinCC_OA_Test/
mkdir -p ${{github.workspace}}/install/WinCCOA_QualityChecks/help

- name: Download ctrlppcheck binaries
uses: actions/download-artifact@v3
with:
name: ctrlppcheck
path: ${{github.workspace}}/install/WinCCOA_QualityChecks/bin/ctrlppcheck/

- name: Download help
uses: actions/download-artifact@v3
with:
name: qt-help
path: ${{github.workspace}}/install/WinCCOA_QualityChecks/help/index.qch

- name: Upload WinCCOA_QualityChecks
uses: actions/upload-artifact@v3
with:
name: WinCCOA_QualityChecks
path: ${{github.workspace}}/install/*

- name: Upload WinCC_OA_Test
uses: actions/upload-artifact@v3
with:
name: WinCC_OA_Test
path: ${{github.workspace}}/tests/*

tests:
name: WinCC OA tests
runs-on: ubuntu-20.04
container:
image: mpokornyetm/winccoa:v3.19.8-full
options: --user root
credentials:
username: mpokornyetm
password: ${{ secrets.DOCKER_CONTAINER_REGISTRY_TOKEN }}
needs: [build, package]

steps:
- name: Print WinCC OA version
shell: bash
run: |
/opt/WinCC_OA/3.19/bin/WCCOActrl -version || true

- name: Download WinCCOA_QualityChecks package
uses: actions/download-artifact@v3
with:
name: WinCCOA_QualityChecks
path: ${{github.workspace}}/

- name: Download WinCC_OA_Test
uses: actions/download-artifact@v3
with:
name: WinCC_OA_Test
path: ${{github.workspace}}/

- name: 'Echo download path'
run: echo ${{steps.download.outputs.download-path}}

- name: Register Ctrl TestFramework
working-directory: ${{github.workspace}}/WinCC_OA_Test/
run: |
cwd=$(pwd)

mkdir -p $cwd/Projects/TfCustomizedQG/config
cd $cwd/Projects/TfCustomizedQG/config

echo "[general]
pvss_path = \"/opt/WinCC_OA/3.19\"
proj_path = \"/opt/WinCC_OA/3.19/TestFramework_3.19\"
proj_path = \"$cwd/Projects/Global\"
proj_path = \"$cwd/Projects/TfCustomizedQG\"
proj_version = \"3.19\"
langs = \"de_AT.utf8\"
langs = \"en_US.utf8\"
pmonPort = 5999
[testFramework]
installPath = \"$cwd/\"
" > config

mkdir -p $$cwd/Projects/TfCustomizedQG/log

/opt/WinCC_OA/3.19/bin/WCCILpmon -config $cwd/Projects/TfCustomizedQG/config/config -n -autofreg -status -log +stderr || true

- name: Start WinCC OA tests
working-directory: /opt/WinCC_OA/3.19/bin/
run: |
echo ****** Execute WinCC OA Tests
ls -la /opt/WinCC_OA/3.19/
./WCCOActrl -proj TfCustomizedQG -n testRunner.ctl {\'testRunId\':\'Regression-tests\',\'registerGlobalProject\':true,\'registerAllTools\':true,\'registerAllTemplates\':true,\'showLogViewer\':false,\'TfTestManager.checkForPossibleFreezeTests\':true} -log +stderr -lang en_US.utf8

- name: Convert WinCC OA tests to jUnit
working-directory: /opt/WinCC_OA/3.19/bin/
run: |
echo ****** Convert results into jUnit format
./WCCOActrl -proj TfCustomizedQG -n oaTestParsers/jsonToJUnit.ctl -log +stderr -lang en_US.utf8

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
with:
fail_on_failure : true
require_tests : true
report_paths : /__w/CtrlppCheck/CtrlppCheck/WinCC_OA_Test/Results/jUnit*.xml

release:
if: github.event_name == 'release'
name: Release
runs-on: ubuntu-20.04
needs: package
needs: tests
steps:

- name: Get the version
Expand All @@ -222,3 +368,24 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: WinCCOA_QualityChecks_${{ github.event.release.tag_name }}.zip


# inspired by https://nimblehq.co/blog/create-github-wiki-pull-request
publish-help:
# !! TODO enable it only on release
# if: github.event_name == 'release'
name: Publish help
runs-on: ubuntu-latest
needs: tests
steps:
- name: Download help
uses: actions/download-artifact@v3
with:
name: html-help
path: ${{github.workspace}}/docs/

- name: Publish GitHub pages help
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.WIKI_ACTION_TOKEN }}
publish_dir: ./docs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

class MockCppCheck : CppCheck
{
string tcId;

public void checkFile(const string &testFile)
{
string s;
fileToString(testFile, s);
s = substr(s, 0, strpos(s, "\n")); // get fist lines
s = substr(s, 0, strpos(s, "\n")); // get first line
const string key = "// start options: ";
int idx = strpos(s, key);

Expand All @@ -32,15 +34,15 @@ class MockCppCheck : CppCheck
else
s = "";

DebugN(__FUNCTION__, testFile, s);
oaUnitInfo(tcId, "Start check of test file: " + testFile + ", with options:" + s);
start(testFile + s);
stdErrToErrList();
}

public void compare(const string &refFile)
{
DebugTN(__FUNCTION__, refFile);
const string tcId = "Ctrlppcheck." + baseName(refFile);
tcId = "Ctrlppcheck." + baseName(refFile);
oaUnitInfo(tcId, "Compare result with reference file: " + refFile);
string str;
bool hasFailedRead = fileToString(refFile, str, "UTF8");
str = str.trim();
Expand Down Expand Up @@ -89,8 +91,6 @@ class MockCppCheck : CppCheck
// DebugN(__FUNCTION__, map, expErr);
oaUnitAssertGreater(tcId, dynContains(simpleErrStrings, expErrorStr), 0, map);
}


}
};

Expand Down Expand Up @@ -163,6 +163,10 @@ class TstCtrlppcheck : OaTest
mkdir(resDir);

moveFile(PROJ_PATH + LOG_REL_PATH + "cppcheck-result.xml", resDir + baseName(refFile));

// please keep this dummy pass() here to eliminate following failure
// Can not determine test case data ('Ctrlppcheck'). Check results for 'suite_CtrlppCheck/CtrlppCheck_App_3.19'
pass("The file " + path + " has been analyzed");
return 0;
}
}
Expand Down
Loading