Update toolbox.yml #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: toolbox | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/toolbox.yml' | |
- 'CMakeLists.txt' | |
- '**' | |
- '!docs/**' | |
pull_request: | |
paths: | |
- '.github/workflows/toolbox.yml' | |
- 'CMakeLists.txt' | |
- '**' | |
- '!docs/**' | |
release: | |
types: [published] | |
jobs: | |
create_installer: | |
if: | | |
${{ github.event_name == 'pull_request' || github.event_name == 'release' }} | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout devtools | |
uses: actions/checkout@v2 | |
- name: Create folders | |
run: | | |
mkdir -p toolbox/cbuild | |
mkdir -p toolbox/packchk | |
mkdir -p toolbox/distribution/bin | |
mkdir -p toolbox/distribution/etc | |
mkdir -p toolbox/distribution/doc | |
- name: Download cbuild release asset | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: "Open-CMSIS-Pack/devtools" | |
version: tags/tools/buildmgr/2.0.0 | |
file: cbuild_install.sh | |
target: toolbox/cbuild/cbuild_install.sh | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download packchk release assets | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: "Open-CMSIS-Pack/devtools" | |
version: tags/tools/packchk/1.4.1 | |
regex: true | |
file: "packchk-.*\\.(zip|tbz2)" | |
target: "toolbox/packchk/" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download svdconv release assets | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: "Open-CMSIS-Pack/devtools" | |
version: tags/tools/svdconv/3.3.45 | |
regex: true | |
file: "svdconv-.*\\.(zip|tbz2)" | |
target: "toolbox/svdconv/" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Unzip and copy files | |
run: | | |
curl https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/v1.7.25/schema/PACK.xsd --output distribution/etc/PACK.xsd | |
sudo chmod +x ./cbuild/cbuild_install.sh | |
./cbuild/cbuild_install.sh -x cbuild | |
cp -r cbuild/bin/* distribution/bin | |
cp -r cbuild/etc/* distribution/etc | |
tar -xvf packchk/packchk-*-darwin-amd64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.mac-amd64 | |
tar -xvf packchk/packchk-*-darwin-arm64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.mac-arm64 | |
tar -xvf packchk/packchk-*-linux-amd64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.lin-amd64 | |
tar -xvf packchk/packchk-*-linux-arm64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.lin-arm64 | |
unzip packchk/packchk-\*-windows-amd64.zip -d packchk && mv packchk/packchk.exe distribution/bin/packchk.exe-amd64 | |
unzip packchk/packchk-\*-windows-arm64.zip -d packchk && mv packchk/packchk.exe distribution/bin/packchk.exe-arm64 | |
tar -xvf svdconv/svdconv-*-darwin-amd64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.mac-amd64 | |
tar -xvf svdconv/svdconv-*-darwin-arm64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.mac-arm64 | |
tar -xvf svdconv/svdconv-*-linux-amd64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.lin-amd64 | |
tar -xvf svdconv/svdconv-*-linux-arm64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.lin-arm64 | |
unzip svdconv/svdconv-\*-windows-amd64.zip -d svdconv && mv svdconv/svdconv.exe distribution/bin/svdconv.exe-amd64 | |
unzip svdconv/svdconv-\*-windows-arm64.zip -d svdconv && mv svdconv/svdconv.exe distribution/bin/svdconv.exe-arm64 | |
cp ../docs/LICENSE.txt distribution | |
cp ../docs/index.html distribution/doc | |
working-directory: toolbox | |
- name: Add execution permission to the binaries and set files ownership | |
run: | | |
sudo chmod -R +x bin/* | |
sudo chown -R root:root * | |
working-directory: toolbox/distribution | |
- name: Create installer | |
id: installer | |
run: | | |
export VERSION=$(echo ${{ github.ref }} | cut -d/ -f5) | |
./create_installer.sh --input=../toolbox/distribution --output=. --version=$VERSION | |
working-directory: installer | |
- name: Archive cmsis-toolbox installer | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cmsis-toolbox | |
path: installer/cmsis-toolbox.sh | |
retention-days: 1 | |
if-no-files-found: error | |
tests: | |
if: | | |
${{ github.event_name == 'pull_request' || github.event_name == 'release' }} | |
needs: [ create_installer ] | |
timeout-minutes: 15 | |
runs-on: ${{ matrix.config.os }} | |
env: | |
CI_TOOLBOX_INSTALLER: ${{ github.workspace }}/cmsis-toolbox.sh | |
strategy: | |
fail-fast: true | |
matrix: | |
config: | |
- { os: macos-12, target: darwin64, arch: amd64 } | |
- { os: macos-12, target: darwin64, arch: arm64 } | |
- { os: windows-2019, target: windows64, arch: amd64} | |
- { os: windows-2019, target: windows64, arch: arm64} | |
- { os: ubuntu-20.04, target: linux64, arch: amd64} | |
- { os: ubuntu-20.04, target: linux64, arch: arm64} | |
steps: | |
- name: Install macos deps | |
if: ${{ startsWith(matrix.config.os, 'macos') }} | |
run: | | |
brew install \ | |
ninja | |
- name: Install linux deps | |
if: ${{ startsWith(matrix.config.os, 'ubuntu') }} | |
run: | | |
sudo apt update | |
sudo apt-get install \ | |
bc \ | |
build-essential \ | |
ninja-build | |
- name: Install windows deps | |
if: ${{ startsWith(matrix.config.os, 'windows') }} | |
run: choco install -y ninja | |
- name: Checkout cmsis-toolbox | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Create build folder | |
run: | | |
mkdir build | |
- name: Download cmsis-toolbox installer | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox | |
path: ${{ github.workspace }} | |
- name: Set correct cmsis-toolbox file permission | |
if: ${{ startsWith(matrix.config.os, 'macos') || startsWith(matrix.config.os, 'ubuntu') }} | |
run: chmod +x cmsis-toolbox.sh | |
- name: Configure windows build for amd64 | |
if: ${{ startsWith(matrix.config.os, 'windows') }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- uses: ammaraskar/gcc-problem-matcher@master | |
if: ${{ startsWith(matrix.config.os, 'macos') || startsWith(matrix.config.os, 'ubuntu') }} | |
- uses: ammaraskar/msvc-problem-matcher@master | |
if: ${{ startsWith(matrix.config.os, 'windows') }} | |
- name: Build and run Toolbox tests | |
run: | | |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. | |
cmake --build . --target ToolboxTest1 | |
ctest -V -C Debug -R ToolboxTest1 | |
working-directory: ./build | |
- name: Archive tests results | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: toolboxtest-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
path: ./build/Testing/Temporary/LastTest.log | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Archive gtest report | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: toolbox_test-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
path: ./build/test_reports/toolboxtest1-*.xml | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Publish Toolbox Test Results | |
uses: mikepenz/action-junit-report@v2 | |
with: | |
check_name: toolbox_test-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
report_paths: build/test_reports/toolboxtest1-${{ matrix.config.target }}.xml | |
release: | |
if: ${{ github.event_name == 'release' }} | |
needs: [ create_installer ] | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout devtools | |
uses: actions/checkout@v2 | |
- name: Download cmsis-toolbox installer | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox | |
path: ${{ github.workspace }} | |
- name: Extract cmsis-toolbox installer files | |
run: | | |
chmod +x cmsis-toolbox.sh | |
./cmsis-toolbox.sh -x toolbox/zip | |
- name: Copy files separated by target for archiving | |
run: | | |
mkdir -p zip/cmsis-toolbox-windows-amd64/bin zip/cmsis-toolbox-windows-amd64/etc zip/cmsis-toolbox-windows-amd64/doc | |
mkdir -p zip/cmsis-toolbox-windows-arm64/bin zip/cmsis-toolbox-windows-arm64/etc zip/cmsis-toolbox-windows-arm64/doc | |
mkdir -p zip/cmsis-toolbox-linux-amd64/bin zip/cmsis-toolbox-linux-amd64/etc zip/cmsis-toolbox-linux-amd64/doc | |
mkdir -p zip/cmsis-toolbox-linux-arm64/bin zip/cmsis-toolbox-linux-arm64/etc zip/cmsis-toolbox-linux-arm64/doc | |
mkdir -p zip/cmsis-toolbox-darwin-amd64/bin zip/cmsis-toolbox-darwin-amd64/etc zip/cmsis-toolbox-darwin-amd64/doc | |
mkdir -p zip/cmsis-toolbox-darwin-arm64/bin zip/cmsis-toolbox-darwin-arm64/etc zip/cmsis-toolbox-darwin-arm64/doc | |
cp zip/bin/cbuild.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuild.exe | |
cp zip/bin/cbuildgen.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuildgen.exe | |
cp zip/bin/cpackget.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cpackget.exe | |
cp zip/bin/csolution.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/csolution.exe | |
cp zip/bin/packchk.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/packchk.exe | |
cp zip/bin/svdconv.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/svdconv.exe | |
cp zip/bin/cbuild.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuild.exe | |
cp zip/bin/cbuildgen.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuildgen.exe | |
cp zip/bin/cpackget.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cpackget.exe | |
cp zip/bin/csolution.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/csolution.exe | |
cp zip/bin/packchk.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/packchk.exe | |
cp zip/bin/svdconv.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/svdconv.exe | |
cp zip/bin/cbuild.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuild | |
cp zip/bin/cbuildgen.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuildgen | |
cp zip/bin/cpackget.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cpackget | |
cp zip/bin/csolution.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/csolution | |
cp zip/bin/packchk.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/packchk | |
cp zip/bin/svdconv.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/svdconv | |
cp zip/bin/cbuild.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuild | |
cp zip/bin/cbuildgen.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuildgen | |
cp zip/bin/cpackget.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cpackget | |
cp zip/bin/csolution.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/csolution | |
cp zip/bin/packchk.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/packchk | |
cp zip/bin/svdconv.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/svdconv | |
cp zip/bin/cbuild.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuild | |
cp zip/bin/cbuildgen.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuildgen | |
cp zip/bin/cpackget.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cpackget | |
cp zip/bin/csolution.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/csolution | |
cp zip/bin/packchk.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/packchk | |
cp zip/bin/svdconv.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/svdconv | |
cp zip/bin/cbuild.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuild | |
cp zip/bin/cbuildgen.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuildgen | |
cp zip/bin/cpackget.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cpackget | |
cp zip/bin/csolution.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/csolution | |
cp zip/bin/packchk.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/packchk | |
cp zip/bin/svdconv.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/svdconv | |
cp zip/LICENSE.txt zip/cmsis-toolbox-windows-amd64/LICENSE.txt | |
cp zip/LICENSE.txt zip/cmsis-toolbox-windows-arm64/LICENSE.txt | |
cp zip/LICENSE.txt zip/cmsis-toolbox-linux-amd64/LICENSE.txt | |
cp zip/LICENSE.txt zip/cmsis-toolbox-linux-arm64/LICENSE.txt | |
cp zip/LICENSE.txt zip/cmsis-toolbox-darwin-amd64/LICENSE.txt | |
cp zip/LICENSE.txt zip/cmsis-toolbox-darwin-arm64/LICENSE.txt | |
rm zip/etc/setup | |
cp -r zip/etc/* zip/cmsis-toolbox-windows-amd64/etc | |
cp -r zip/etc/* zip/cmsis-toolbox-windows-arm64/etc | |
cp -r zip/etc/* zip/cmsis-toolbox-linux-amd64/etc | |
cp -r zip/etc/* zip/cmsis-toolbox-linux-arm64/etc | |
cp -r zip/etc/* zip/cmsis-toolbox-darwin-amd64/etc | |
cp -r zip/etc/* zip/cmsis-toolbox-darwin-arm64/etc | |
cp -r zip/doc/* zip/cmsis-toolbox-windows-amd64/doc | |
cp -r zip/doc/* zip/cmsis-toolbox-windows-arm64/doc | |
cp -r zip/doc/* zip/cmsis-toolbox-linux-amd64/doc | |
cp -r zip/doc/* zip/cmsis-toolbox-linux-arm64/doc | |
cp -r zip/doc/* zip/cmsis-toolbox-darwin-amd64/doc | |
cp -r zip/doc/* zip/cmsis-toolbox-darwin-arm64/doc | |
working-directory: toolbox | |
- name: Set toolchain default paths | |
run: | | |
./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-amd64/etc | |
./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-arm64/etc | |
./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-amd64/etc | |
./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-arm64/etc | |
./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-amd64/etc | |
./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-arm64/etc | |
- name: Zip folders | |
run: | | |
zip -r cmsis-toolbox-windows-amd64.zip cmsis-toolbox-windows-amd64 | |
zip -r cmsis-toolbox-windows-arm64.zip cmsis-toolbox-windows-arm64 | |
tar -czvf cmsis-toolbox-linux-amd64.tar.gz cmsis-toolbox-linux-amd64 | |
tar -czvf cmsis-toolbox-linux-arm64.tar.gz cmsis-toolbox-linux-arm64 | |
tar -czvf cmsis-toolbox-darwin-amd64.tar.gz cmsis-toolbox-darwin-amd64 | |
tar -czvf cmsis-toolbox-darwin-arm64.tar.gz cmsis-toolbox-darwin-arm64 | |
working-directory: toolbox/zip | |
- name: Calculate checksums | |
run: | | |
sha256sum cmsis-toolbox-windows-amd64.zip --text > cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-windows-arm64.zip --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-linux-amd64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-linux-arm64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-darwin-amd64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-darwin-arm64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
working-directory: toolbox/zip | |
- name: Attach installer to release assets | |
id: release_assets | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: toolbox/zip/cmsis-toolbox-* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |