Skip to content

quotes

quotes #476

Workflow file for this run

#
# Copyright (c) 2019 Broadcom.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Broadcom, Inc. - initial API and implementation
#
name: CI
on:
push:
branches:
- master
- development
- release-next
- ci_other_arms
pull_request:
branches:
- master
- development
workflow_dispatch:
env:
CLIENT_DIR: clients/vscode-hlasmplugin
defaults:
run:
shell: sh
jobs:
formal-checks:
name: Checks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run clang-format
run: clang-format-14 -style=file -n $(find . -name \*.h -print -o -name \*.cpp -print) 2>&1 | tee clang-format-output.txt
- name: Check format
run: |
if [ -s clang-format-output.txt ]
then
exit 1
fi
- name: Check license headers
run: cmake/check_license.sh
- name: PR to master is allowed only from a release branch
if: github.event_name == 'pull_request' && github.base_ref == 'master' && github.head_ref != 'release-next'
run: exit 1
release-info:
name: Update version and changelogs
runs-on: ubuntu-22.04
permissions:
contents: write
issues: write
pull-requests: write
needs: [formal-checks]
steps:
- uses: actions/checkout@v4
- name: NPM CI
run: npm ci
working-directory: ${{ env.CLIENT_DIR }}
- name: Get release context
if: ${{ !(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release-next') }}
run: |
git fetch --filter=tree:0 --unshallow origin HEAD
git fetch --tags --filter=tree:0 `node -e 'console.log(require("./clients/vscode-hlasmplugin/package.json").repository.url)'` master:master
- name: Name PR merge commit
if: github.event.pull_request
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
[ -z "$TITLE" ] || git commit --amend -m "$TITLE"
git checkout -b $GITHUB_REF
env:
TITLE: ${{ github.event.pull_request.title }}
- name: Update version
run: npx semantic-release --dry-run
working-directory: ${{ env.CLIENT_DIR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HLASM_ALPHA_BUILD: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release-next') && '0' || '1' }}
- name: Upload Release Info
uses: actions/upload-artifact@v4
with:
name: release-info
path: |
CHANGELOG.md
${{ env.CLIENT_DIR }}/package.json
${{ env.CLIENT_DIR }}/CHANGELOG.md
generate_grammar:
name: Generate grammar
runs-on: ubuntu-22.04
needs: [formal-checks]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache
with:
path: build/generated_parser
key: ${{ hashFiles('**/CMakeLists.txt', 'cmake/**', 'parser_library/src/parsing/grammar/**') }}
- name: Set up JDK 11
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Generate grammar
if: steps.cache.outputs.cache-hit != 'true'
run: |
mkdir build && cd build
cmake -DBUILD_VSIX=Off -DBUILD_TESTING=Off ../
cmake --build . --target generate_grammar
- name: Upload generated files
uses: actions/upload-artifact@v4
with:
name: grammar
path: build/generated_parser/hlasmparser_*.*
sanitizer-builds:
name: Build with sanitizers
runs-on: ubuntu-22.04
needs: [generate_grammar]
strategy:
matrix:
include:
- flags: address,undefined
- flags: thread
steps:
- uses: actions/checkout@v4
- name: Download generated files
uses: actions/download-artifact@v4
with:
name: grammar
path: build/generated_parser
- name: Requirements install
run: |
sudo apt-get update
sudo apt-get install ninja-build
- name: Configure
run: cmake -G Ninja -DBUILD_VSIX=Off -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.flags }}" -DWITH_LIBCXX=Off -DUSE_PRE_GENERATED_GRAMMAR="generated_parser" ../
working-directory: build
- name: Build
run: cmake --build .
working-directory: build
- name: Test
run: |
./server_test
./library_test
./hlasm_utils_test
working-directory: build/bin
aarch64-linux-musl:
name: Create Linux arm64 docker images
runs-on: alpine:3.19
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache
with:
path: toolchain.tar.gz
key: ${{ hashFiles('scripts/toolchain.linux_arm64.sh') }}
- name: Build image
if: steps.cache.outputs.cache-hit != 'true'
run: ./scripts/toolchain.linux_arm64.sh
build-matrix:
name: Build
runs-on: ${{ matrix.os }}
needs: [generate_grammar, aarch64-linux-musl]
strategy:
matrix:
include:
- os: ubuntu-22.04
native: linux_x64
container: alpine:3.16
dbg-strip: objcopy --only-keep-debug language_server language_server.dbg && objcopy --strip-unneeded language_server && objcopy --add-gnu-debuglink=language_server.dbg language_server
dbg-pattern: build/bin/language_server.dbg
- os: ubuntu-22.04
native: linux_arm64
container: alpine:3.19
dbg-strip: aarch64-linux-musl-objcopy --only-keep-debug language_server language_server.dbg && aarch64-linux-musl-objcopy --strip-unneeded language_server && aarch64-linux-musl-objcopy --add-gnu-debuglink=language_server.dbg language_server
dbg-pattern: build/bin/language_server.dbg
- os: ubuntu-22.04
native: wasm
container: emscripten/emsdk:3.1.46
artifacts-ext: .*
- os: windows-2022
native: win32_x64
artifacts-ext: .exe
- os: windows-2022
native: win32_arm64
artifacts-ext: .exe
skip-test: true
- os: macos-13
native: darwin_x64
- os: macos-14
native: darwin_arm64
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- name: Download generated files
uses: actions/download-artifact@v4
with:
name: grammar
path: build/generated_parser
- name: Requirements install
run: if [ -f ./scripts/prereq.${{ matrix.native }}.sh ]; then ./scripts/prereq.${{ matrix.native }}.sh; fi
- name: Download toolchain
if: ${{ hashFiles(format('scripts/toolchain.{0}.sh', matrix.native)) != '' }}
uses: actions/cache/restore@v4
with:
path: toolchain.tar.gz
key: ${{ hashFiles(format('scripts/toolchain.{0}.sh', matrix.native)) }}
fail-on-cache-miss: true
- name: Extract toolchain
if: ${{ hashFiles(format('scripts/toolchain.{0}.sh', matrix.native)) != '' }}
run: |
tar xzf toolchain.tar.gz
echo "$PWD/toolchain/bin" >> $GITHUB_PATH
- name: Configure
run: ../scripts/config.${{ matrix.native }}.sh
working-directory: build
- name: Build
run: cmake --build . $([ -f ../scripts/build-extra.${{ matrix.native }}.conf ] && cat ../scripts/build-extra.${{ matrix.native }}.conf || true)
working-directory: build
- name: Server Test
if: ${{ !matrix.skip-test }}
run: |
if [ -f ../../scripts/test-runner.${{ matrix.native }}.sh ]; then
../../scripts/test-runner.${{ matrix.native }}.sh ./library_test
../../scripts/test-runner.${{ matrix.native }}.sh ./server_test
../../scripts/test-runner.${{ matrix.native }}.sh ./hlasm_utils_test
else
./library_test
./server_test
./hlasm_utils_test
fi
working-directory: build/bin
- name: Strip debug info
if: ${{ matrix.dbg-strip }}
run: ${{ matrix.dbg-strip }}
working-directory: build/bin
- name: Actions artifact
uses: actions/upload-artifact@v4
with:
name: language_server_${{ matrix.native }}
path: build/bin/language_server${{ matrix.artifacts-ext }}
- name: Actions artifact
if: ${{ matrix.dbg-pattern }}
uses: actions/upload-artifact@v4
with:
name: language_server_${{ matrix.native }}_dbg
path: ${{ matrix.dbg-pattern }}
test-matrix:
name: Test
runs-on: ${{ matrix.os }}
needs: [build-matrix]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
native: linux_x64
chmod: true
- os: windows-2019
native: win32_x64
chmod: false
- os: macos-11
native: darwin_x64
chmod: true
- os: ubuntu-22.04
native: linux_x64
chmod: true
- os: ubuntu-22.04
native: linux_arm64
chmod: true
- os: windows-2022
native: win32_x64
chmod: false
- os: macos-12
native: darwin_x64
chmod: true
- os: macos-13
native: darwin_x64
chmod: true
- os: macos-14
native: darwin_arm64
chmod: true
env:
XVFB: ${{ startsWith(matrix.native, 'linux') && 'xvfb-run -a' || '' }}
defaults:
run:
working-directory: ${{ env.CLIENT_DIR }}
steps:
- uses: actions/checkout@v4
- name: Download native language server
uses: actions/download-artifact@v4
with:
name: language_server_${{ matrix.native }}
path: ${{ env.CLIENT_DIR }}/bin/${{ matrix.native }}/
- name: Download wasm language server
uses: actions/download-artifact@v4
with:
name: language_server_wasm
path: ${{ env.CLIENT_DIR }}/bin/wasm/
- name: Set executable flag
if: ${{ matrix.chmod }}
run: chmod +x bin/${{ matrix.native }}/language_server
- name: Setup emulation
if: ${{ hashFiles(format('scripts/emulation.{0}.sh', matrix.native)) != '' }}
run: ./scripts/emulation.${{ matrix.native }}.sh
- name: NPM CI
run: npm ci
- name: Extension Test
run: ${{ env.XVFB }} npm run test
- name: Extension Test WASM
run: ${{ env.XVFB }} npm run test:wasm
- name: Extension Test Insiders
run: ${{ env.XVFB }} npm run test:insiders
VSIX-web:
name: Test and VSIX (Web)
runs-on: ubuntu-22.04
needs: [build-matrix, release-info]
steps:
- uses: actions/checkout@v4
- name: Download wasm language server
uses: actions/download-artifact@v4
with:
name: language_server_wasm
path: ${{ env.CLIENT_DIR }}/bin/wasm/
- name: Download Release Info
uses: actions/download-artifact@v4
with:
name: release-info
- name: NPM CI
run: npm ci
working-directory: ${{ env.CLIENT_DIR }}
- name: Inject telemetry key
run: |
export TEL_KEY=`node -e "console.log(Buffer.from('${{ secrets.TELEMETRY_KEY }}').toString('base64'))"`
sed -i "s/const TELEMETRY_KEY_ENCODED = TELEMETRY_DEFAULT_KEY/const TELEMETRY_KEY_ENCODED = '$TEL_KEY'/" src/telemetry.ts
working-directory: ${{ env.CLIENT_DIR }}
- name: NPM Compile
run: npm run compile:web
working-directory: ${{ env.CLIENT_DIR }}
- name: NPM Test
run: npm run test:web
working-directory: ${{ env.CLIENT_DIR }}
- name: Package VSIX
run: npx vsce package ${{ github.ref == 'refs/heads/master' && ' ' || '--pre-release' }} --no-dependencies --target web -o hlasm-language-support-web.vsix --baseContentUrl "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/"
working-directory: ${{ env.CLIENT_DIR }}
- name: Upload VSIX
uses: actions/upload-artifact@v4
with:
name: hlasm-language-support-web.vsix
path: ${{ env.CLIENT_DIR }}/hlasm-language-support-web.vsix
VSIX:
runs-on: ubuntu-22.04
needs: [build-matrix, release-info]
steps:
- uses: actions/checkout@v4
- name: Download windows language server (x64)
uses: actions/download-artifact@v4
with:
name: language_server_win32_x64
path: ${{ env.CLIENT_DIR }}/bin/win32_x64/
- name: Download windows language server (arm64)
uses: actions/download-artifact@v4
with:
name: language_server_win32_arm64
path: ${{ env.CLIENT_DIR }}/bin/win32_arm64/
- name: Download linux language server (x64)
uses: actions/download-artifact@v4
with:
name: language_server_linux_x64
path: ${{ env.CLIENT_DIR }}/bin/linux_x64/
- name: Download linux language server (arm64)
uses: actions/download-artifact@v4
with:
name: language_server_linux_arm64
path: ${{ env.CLIENT_DIR }}/bin/linux_arm64/
- name: Download wasm language server
uses: actions/download-artifact@v4
with:
name: language_server_wasm
path: ${{ env.CLIENT_DIR }}/bin/wasm/
- name: Download MacOS language server (x64)
uses: actions/download-artifact@v4
with:
name: language_server_darwin_x64
path: ${{ env.CLIENT_DIR }}/bin/darwin_x64/
- name: Download MacOS language server (arm64)
uses: actions/download-artifact@v4
with:
name: language_server_darwin_arm64
path: ${{ env.CLIENT_DIR }}/bin/darwin_arm64/
- name: Download Release Info
uses: actions/download-artifact@v4
with:
name: release-info
- name: Set executable flag
run: |
chmod +x ${{ env.CLIENT_DIR }}/bin/darwin_x64/language_server
chmod +x ${{ env.CLIENT_DIR }}/bin/darwin_arm64/language_server
chmod +x ${{ env.CLIENT_DIR }}/bin/linux_x64/language_server
chmod +x ${{ env.CLIENT_DIR }}/bin/linux_arm64/language_server
- name: NPM CI
run: npm ci
working-directory: ${{ env.CLIENT_DIR }}
- name: Inject telemetry key
run: |
export TEL_KEY=`node -e "console.log(Buffer.from('${{ secrets.TELEMETRY_KEY }}').toString('base64'))"`
sed -i "s/const TELEMETRY_KEY_ENCODED = TELEMETRY_DEFAULT_KEY/const TELEMETRY_KEY_ENCODED = '$TEL_KEY'/" src/telemetry.ts
working-directory: ${{ env.CLIENT_DIR }}
- name: NPM Compile
run: npm run compile
working-directory: ${{ env.CLIENT_DIR }}
- name: Package VSIX
run: npx vsce package ${{ github.ref == 'refs/heads/master' && ' ' || '--pre-release' }} --no-dependencies -o hlasm-language-support.vsix --baseContentUrl "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/"
working-directory: ${{ env.CLIENT_DIR }}
- name: Upload VSIX
uses: actions/upload-artifact@v4
with:
name: hlasm-language-support.vsix
path: ${{ env.CLIENT_DIR }}/hlasm-language-support.vsix
release:
name: Release VSIXs
runs-on: ubuntu-22.04
permissions:
contents: write
issues: write
pull-requests: write
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'push' && github.ref == 'refs/heads/release-next')
needs: [VSIX, VSIX-web, test-matrix, sanitizer-builds, theia-test]
steps:
- uses: actions/checkout@v4
- name: Download VSIX
uses: actions/download-artifact@v4
with:
name: hlasm-language-support.vsix
path: ${{ env.CLIENT_DIR }}
- name: Download Web VSIX
uses: actions/download-artifact@v4
with:
name: hlasm-language-support-web.vsix
path: ${{ env.CLIENT_DIR }}
- name: Download Release Info
uses: actions/download-artifact@v4
with:
name: release-info
- name: Commit changes
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git add CHANGELOG.md ${{ env.CLIENT_DIR }}/package.json ${{ env.CLIENT_DIR }}/CHANGELOG.md
git commit -m "chore: Update version & changelog [skip ci]"
git push origin master
- name: NPM CI
run: npm ci
working-directory: ${{ env.CLIENT_DIR }}
- name: Release new version
run: npx semantic-release
working-directory: ${{ env.CLIENT_DIR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge master into development
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
git stash
git fetch
git checkout origin/development
git merge origin/master
cd ${{ env.CLIENT_DIR }}
sed -i '2s/^/\n## ****Unreleased****\n/' CHANGELOG.md
git add package.json CHANGELOG.md
git commit -m "chore: Prepare for next development cycle [skip ci]"
- name: Push changes
if: github.event_name == 'push'
run: git push origin HEAD:development
- name: Delete PRs head branches
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: git push origin --delete release-next
theia-test:
name: Theia Integration Test
runs-on: ubuntu-22.04
needs: VSIX
strategy:
matrix:
theia: ["ghcr.io/eclipse-theia/theia-blueprint/blueprint:1.35.0"]
# theiaide images not supported anymore
container:
image: ${{ matrix.theia }}
options: --user root
steps:
- name: Workaround for git safe.directory feature
run: chown root:root .
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Chromium
run: apt-get update && apt-get install -y chromium
- name: Download VSIX
uses: actions/download-artifact@v4
with:
name: hlasm-language-support.vsix
path: ${{ env.CLIENT_DIR }}/plugin/
- name: npm ci
run: npm ci
working-directory: ${{ env.CLIENT_DIR }}
- name: Run Theia Tests
run: npm run test:theia /home/theia/applications/browser/
working-directory: ${{ env.CLIENT_DIR }}