Skip to content

Nightly

Nightly #257

Workflow file for this run

name: Nightly
on:
schedule:
- cron: '0 5 * * *' # nightly at 05:00 UTC
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
validate-markdown-links:
name: Validate Markdown Links
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Validate Links
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
with:
args: --config .github/lychee.toml './**/*.md'
fail: true
jobSummary: false
build:
if: github.repository == 'Open-CMSIS-Pack/vscode-cmsis-debugger'
strategy:
matrix:
platform: [ubuntu-24.04, windows-2022, macos-14]
include:
- platform: ubuntu-24.04
target: linux
- platform: windows-2022
target: windows
- platform: macos-14
target: darwin
runs-on: ${{ matrix.platform }}
outputs:
nightly_version: ${{ steps.set_version.outputs.nightly_version }}
permissions:
packages: read
name: 'Build and test (${{ matrix.target }})'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- run: git config --global core.autocrlf false
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version-file: package.json
registry-url: https://npm.pkg.github.com
package-manager-cache: false
- name: Set version
id: set_version
if: runner.os == 'Linux' && github.repository_owner == 'Open-CMSIS-Pack'
run: |
DESCRIBE=$(git describe --tags | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
QUALIFIER=$(git describe --tags | grep -Eo '[0-9]+\-g[0-9a-f]+$' || true)
BASE="${DESCRIBE#v}"
IFS='.' read -r MAJ MIN PAT <<< "$BASE"
PR_VERSION="${MAJ}.${MIN}.$((PAT + 1))${QUALIFIER:+-${QUALIFIER}}"
npm version --no-git-tag-version --new-version "${PR_VERSION}"
VERSION="$(jq -r ".version" < package.json)"
sed -i "s/## Unreleased/## ${VERSION}/" CHANGELOG.md
echo "Version is ${VERSION}"
echo "nightly_version=${VERSION}" >> $GITHUB_OUTPUT
- name: Remove badges
if: runner.os == 'Linux'
run: |
sed -i "/https:\/\/qlty\.sh\/gh/d" README.md
sed -i "/https:\/\/securityscorecards\.dev\/viewer/d" README.md
sed -i "/https:\/\/img.shields.io\//d" README.md
- name: Install dependencies
env:
GITHUB_TOKEN: ${{ github.token }}
run: npm ci
- name: Build on Windows or macOS
if: runner.os != 'Linux'
run: npm run build:no-lint
- name: Build on Linux
if: runner.os == 'Linux'
run: npm run build
- name: Check copyright
if: runner.os == 'Linux'
run: npm run copyright:check
- name: Test
run: npm run test
- name: Upload dist
if: runner.os == 'Linux'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: |
./README.md
./CHANGELOG.md
./package.json
./dist
retention-days: 1
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: runner.os == 'Linux'
with:
name: test-coverage
path: ./coverage
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-report-${{ matrix.target }}
path: ./test-report.html
- name: Publish coverage report to QLTY
if: github.repository_owner == 'Open-CMSIS-Pack' && runner.os == 'Linux'
uses: qltysh/qlty-action/coverage@a19242102d17e497f437d7466aa01b528537e899 # v2.2.0
with:
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
files: coverage/lcov.info
package:
name: Package
runs-on: [ubuntu-latest]
needs: build
env:
NIGHTLY_VERSION: ${{ needs.build.outputs.nightly_version }}
strategy:
fail-fast: true
matrix:
target:
- win32-x64
- win32-arm64
- linux-x64
- linux-arm64
- darwin-arm64
permissions:
packages: read
actions: read # For fetching workflow artifacts with 'download-tools --nightly'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Configure git settings
run: git config --global core.autocrlf false
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version-file: package.json
registry-url: https://npm.pkg.github.com
package-manager-cache: false
- name: Download dist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: .
- name: Download tools (Nightly Builds)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
npm run download-tools:nightly -- --target ${{ matrix.target }} --no-cache
- name: Create vsix package
run: |
npm run package -- --target ${{ matrix.target }} --out "vscode-cmsis-debugger-nightly-${{ matrix.target }}-${NIGHTLY_VERSION}.vsix"
- name: Upload package
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: ./*${{ matrix.target }}*.vsix
archive: false
retention-days: 1
validate:
name: Validate package (${{ matrix.target }})
runs-on: ${{ matrix.platform }}
needs: package
strategy:
fail-fast: false
matrix:
include:
- target: win32-x64
platform: windows-2022
- target: win32-arm64
platform: windows-2022
- target: linux-x64
platform: ubuntu-24.04
- target: linux-arm64
platform: ubuntu-24.04
- target: darwin-arm64
platform: macos-14
permissions:
packages: read
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Configure git settings
run: git config --global core.autocrlf false
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version-file: package.json
registry-url: https://npm.pkg.github.com
package-manager-cache: false
- name: Install dependencies
run: npm ci
- name: Download vsix package
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: vscode-cmsis-debugger-nightly-${{ matrix.target }}-*.vsix
- name: Validate VSIX contents
shell: bash
run: |
VSIX_FILE=$(ls *.vsix)
echo "Validating VSIX: $VSIX_FILE"
npm run validate-tools -- --target ${{ matrix.target }} --vsix "$VSIX_FILE"