Skip to content

Commit

Permalink
Add build workflow
Browse files Browse the repository at this point in the history
- Restructuring documentation
- Update documentation version dropdown
- Move doxygen revision history to generated file
- Fix broken hyperlinks
- Rework gen_pack.sh to gen-pack library
  • Loading branch information
JonatanAntoni authored Aug 30, 2022
1 parent 8c6f7c8 commit 4bd92d7
Show file tree
Hide file tree
Showing 96 changed files with 810 additions and 184 deletions.
16 changes: 16 additions & 0 deletions .github/doxygen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "doxygen",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+): warning: (.*)$",
"file": 1,
"line": 2,
"message": 3
}
]
}
]
}
18 changes: 18 additions & 0 deletions .github/linkchecker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "linkchecker",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+);(.*);(.*);(.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 5,
"message": 6
}
]
}
]
}
20 changes: 20 additions & 0 deletions .github/packchk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"problemMatcher": [
{
"owner": "packchk",
"severity": "warning",
"pattern": [
{
"regexp": "^\\*\\*\\* (INFO|WARNING) M(\\d+): (.*) \\(Line (\\d+)\\)$",
"file": 3,
"line": 4,
"code": 2
},
{
"regexp": "^ (.*)$",
"message": 1
}
]
}
]
}
147 changes: 147 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Build documentation and pack
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]
jobs:
pack:
name: Generate pack
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fetch tags
if: ${{ github.event_name == 'release' }}
run: |
git fetch --tags --force
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libclang1-9 libclang-cpp1-9 p7zip libxml2-utils
sudo pip install LinkChecker
- name: Install doxygen 1.9.2
run: |
wget https://doxygen.nl/files/doxygen-1.9.2.linux.bin.tar.gz
sudo tar -C /opt -xf doxygen-1.9.2.linux.bin.tar.gz
sudo ln -s /opt/doxygen-1.9.2/bin/doxygen /usr/local/bin/
which doxygen
doxygen --version
- name: Install PackChk 1.3.95
run: |
wget https://github.com/Open-CMSIS-Pack/devtools/releases/download/tools%2Fpackchk%2F1.3.95/packchk-1.3.95-linux64.zip
unzip packchk-1.3.95-linux64.zip
sudo mv packchk /usr/local/bin
which packchk
packchk --version
- name: Generate doxygen
run: |
echo "::add-matcher::.github/doxygen.json"
./gen_doc.sh
echo "::remove-matcher owner=doxygen::"
working-directory: ./Doxygen

- name: Run linkchecker
run: |
echo "::add-matcher::.github/linkchecker.json"
../Scripts/check_links.sh ./html/index.html ../Doxygen
echo "::remove-matcher owner=linkchecker::"
working-directory: ./Documentation

- name: Archive documentation
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v2
with:
name: documentation
path: Documentation/html/
retention-days: 1
if-no-files-found: error

- name: Archive documentation
if: ${{ github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
cd Documentation/html
tar -cvjf /tmp/doc.tbz2 .
- name: Generate pack
id: pack
run: |
mkdir -p ~/.arm/Packs/.Web
wget -O ~/.arm/Packs/.Web/ARM.CMSIS.pdsc https://www.keil.com/pack/ARM.CMSIS.pdsc
echo "::add-matcher::.github/packchk.json"
./gen_pack.sh
echo "::remove-matcher owner=packchk::"
- name: Archive pack
if: ${{ github.event_name != 'release' }}
uses: actions/upload-artifact@v2
with:
path: output/*.pack
retention-days: 1
if-no-files-found: error

- name: Attach pack to release assets
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: output/*.pack
tag: ${{ github.ref }}
overwrite: true

- name: Update release description
if: ${{ github.event_name == 'release' }}
run: |
CURRENT="$(gh release view ${{ github.ref }} --json body -t "{{.body}}")"
if [[ -z "$CURRENT" ]]; then
DESC=$(git tag -l -n99 --format "%(contents)" ${{ github.ref }})
gh release edit -n "$DESC"
fi
- uses: actions/checkout@v2
if: ${{ github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
with:
ref: gh-pages

- name: Publish documentation
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
rm -rf main
mkdir main
pushd main
tar -xvjf /tmp/doc.tbz2
popd
./update_versions.sh
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Update main documentation"
git push
- name: Publish documentation
if: ${{ github.event_name == 'release' }}
run: |
RELEASE=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
rm -rf ${RELEASE}
mkdir -p ${RELEASE}
rm -f latest
ln -s ${RELEASE} latest
pushd ${RELEASE}
tar -xvjf /tmp/doc.tbz2
popd
./update_versions.sh
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Update documentation for release ${RELEASE}"
git push
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
*.dylib

Local_Release
Documentation/html
Doxygen/view.dxy
/PACK.xsd
/output/ARM.CMSIS-View.1.1.2-dev4+ge8d94f5.pack
/output
/build
/Doxygen/src/history.md

# Test binary, built with `go test -c`
*.test
Expand Down
16 changes: 5 additions & 11 deletions ARM.CMSIS-View.pdsc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package schemaVersion="1.6.3" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd">
<package schemaVersion="1.7.7" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/v1.7.7/schema/PACK.xsd">
<vendor>ARM</vendor>
<name>CMSIS-View</name>
<description>Debugger visualization of software events and statistics</description>
Expand All @@ -8,14 +8,8 @@
<repository type="git">https:/github.com/arm-software/CMSIS-View.git</repository>

<releases>
<release version="1.1.1" date="2022-03-31" tag="1.1.1" url="https://github.com/ARM-software/CMSIS-View/archive/1.1.1.zip">
Added clock frequency to internal Event Recorder Initialization message.
</release>
<release version="1.1.0" date="2022-02-25" tag="1.1.0" url="https://github.com/ARM-software/CMSIS-View/archive/1.1.0.zip">
Added Event Recorder logging via Semihosting.
</release>
<release version="1.0.0" date="2021-01-26" tag="1.0.0" url="https://github.com/ARM-software/CMSIS-View/archive/1.0.0.zip">
Open Source Version of Event Recorder Version 1.4.0 under Apache 2.0.
<release version="0.0.0">
Active development ...
</release>
</releases>

Expand Down Expand Up @@ -51,7 +45,7 @@
<file category="header" name="EventRecorder/Config/EventRecorderConf.h" attr="config" version="1.1.0"/>
<file category="header" name="EventRecorder/Include/EventRecorder.h"/>
<file category="source" name="EventRecorder/Source/EventRecorder.c"/>
<!-- <file category="doc" name="EventRecorder/Doc/html/index.html"/> -->
<file category="doc" name="Documentation/html/index.html"/>
<file category="other" name="EventRecorder/EventRecorder.scvd"/>
</files>
</component>
Expand All @@ -66,7 +60,7 @@
<file category="header" name="EventRecorder/Config/EventRecorderConf.h" attr="config" version="1.1.0"/>
<file category="header" name="EventRecorder/Include/EventRecorder.h"/>
<file category="source" name="EventRecorder/Source/EventRecorder.c"/>
<!-- <file category="doc" name="EventRecorder/Doc/html/index.html"/> -->
<file category="doc" name="Documentation/html/index.html"/>
<file category="other" name="EventRecorder/EventRecorder.scvd"/>
</files>
</component>
Expand Down
3 changes: 0 additions & 3 deletions Doc/DoxyTemplates/footer.js

This file was deleted.

28 changes: 0 additions & 28 deletions Doc/DoxyTemplates/printComponentTabs.js

This file was deleted.

62 changes: 0 additions & 62 deletions Doc/gen_doc.sh

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions Documentation/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function writeVersionDropdown() {
};
Loading

0 comments on commit 4bd92d7

Please sign in to comment.