App catalogue & Qodex #421
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
# This is a basic workflow to help you get started with Actions | |
name: VSIX on PR | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the develop branch | |
on: | |
pull_request: | |
branches: | |
- develop | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
CreateVSIXOnPR: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Get current time for the commit | |
- name: Get current time | |
uses: josStorer/[email protected] | |
id: current_time | |
with: | |
format: YYYYMMDD-HH | |
utcOffset: '+01:00' | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Get repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Print head git commit message | |
id: get_head_commit_message | |
run: echo "::set-output name=HEAD_COMMIT_MESSAGE::$(git show -s --format=%s)" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.19.0 | |
- name: Save release version to outputs | |
id: save_release_version | |
run: echo ::set-output name=version::$(node -pe "require('./package.json').version") | |
- name: Installing modules | |
id: install_modules | |
run: | | |
npm install | |
cd frontend | |
yarn install | |
yarn build | |
yarn install-playwright | |
yarn build-storybook --quiet | |
- name: Run unit tests | |
run: | | |
cd frontend | |
yarn test | |
- name: Serve Storybook and run tests | |
run: | | |
cd frontend | |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
"npx http-server storybook-static --port 6006 --silent" \ | |
"npx wait-on tcp:6006 && yarn test-storybook" | |
- name: Publish to Chromatic | |
id: chromatic_publish | |
uses: chromaui/action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
storybookBaseDir: ./frontend | |
exitZeroOnChanges: true | |
allowConsoleErrors: true | |
debug: true | |
- name: Package | |
id: package | |
run: ./node_modules/.bin/vsce package --no-yarn | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: IDE v${{ steps.save_release_version.outputs.version }} | |
path: ./*.vsix | |
# Notify Discord if Success | |
- name: Discord notification | |
env: | |
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}} | |
DISCORD_EMBEDS: '[{ "author": { "icon_url": "https://avatars.githubusercontent.com/${{ github.actor }}", "name": "${{ github.actor }}", "url": "https://github.com/${{github.actor}}" },"url": "https://github.com/${{github.repository}}/commit/${{github.sha}}","fields": [{ "name": "Commit Message", "value": "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}"},{ "name": "Repository", "value": "[${{github.event.repository.name}}](${{github.event.repository.clone_url}})", "inline": true },{ "name": "Branch", "value": "[${{github.ref_name}}](https://github.com/${{github.repository}}/pull/${{github.ref_name}})", "inline": true },{ "name": "Event", "value": "${{github.event_name}}", "inline": true },{ "name": "Author", "value": "[${{github.actor}}](https://github.com/${{github.actor}})", "inline": true },{ "name": "Job", "value": "${{github.job}}", "inline": true},{ "name": "Version", "value": "v${{ steps.save_release_version.outputs.version }}", "inline": true},{ "name": "", "value": "🤖 [Github Action](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id}})"}],"color":65280,"footer":{"text": "Published at ${{steps.current_time.outputs.readableTime}}"}}]' | |
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true' | |
uses: Ilshidur/[email protected] | |
with: | |
args: ':white_check_mark: Tests run #${{ github.run_number }} for [PR](${{ github.event.pull_request.html_url }}) triggered by ${{ github.triggering_actor }} *succeeded*, click GitHub Action link below to get the VSIX artifact.' | |
if: success() | |
# Notify discord if failure | |
- name: Discord notification | |
env: | |
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}} | |
DISCORD_EMBEDS: '[{ "author": { "icon_url": "https://avatars.githubusercontent.com/${{ github.actor }}", "name": "${{ github.actor }}", "url": "https://github.com/${{github.actor}}" },"url": "https://github.com/${{github.repository}}/commit/${{github.sha}}","fields": [{ "name": "Commit Message", "value": "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}"},{ "name": "Repository", "value": "[${{github.event.repository.name}}](${{github.event.repository.clone_url}})", "inline": true },{ "name": "Branch", "value": "[${{github.ref_name}}](https://github.com/${{github.repository}}/pull/${{github.ref_name}})", "inline": true },{ "name": "Event", "value": "${{github.event_name}}", "inline": true },{ "name": "Author", "value": "[${{github.actor}}](https://github.com/${{github.actor}})", "inline": true },{ "name": "Job", "value": "${{github.job}}", "inline": true },{ "name": "Version", "value": "v${{ steps.save_release_version.outputs.version }}", "inline": true},{ "name": "", "value": "🤖 [Github Action](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id}})"}],"color":16711680,"footer":{"text": "Published at ${{steps.current_time.outputs.readableTime}}"}}]' | |
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true' | |
uses: Ilshidur/[email protected] | |
with: | |
args: ':exclamation: Tests run #${{ github.run_number }} for [PR](${{ github.event.pull_request.html_url }}) triggered by ${{ github.triggering_actor }} *failed*!' | |
if: failure() |