Skip to content

Refactor tests for Zendesk actions and add tests for Organization and Group actions, make Ticket required in schema #88

Refactor tests for Zendesk actions and add tests for Organization and Group actions, make Ticket required in schema

Refactor tests for Zendesk actions and add tests for Organization and Group actions, make Ticket required in schema #88

Workflow file for this run

name: Pull Request Tests
# 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
env:
ZENDESK_SUBDOMAIN: ${{ secrets.ZENDESK_SUBDOMAIN }}
ZENDESK_USER: ${{ secrets.ZENDESK_USER }}
ZENDESK_API_KEY: ${{ secrets.ZENDESK_API_KEY }}
SLACK_ACCESS_TOKEN: ${{ secrets.SLACK_ACCESS_TOKEN }}
SLACK_USER_ACCESS_TOKEN: ${{ secrets.SLACK_USER_ACCESS_TOKEN }}
SLACK_USER_EMAIL: ${{ secrets.SLACK_USER_EMAIL }}
DROPBOX_REFRESH_TOKEN: ${{ secrets.DROPBOX_REFRESH_TOKEN }}
DROPBOX_CLIENT_ID: ${{ secrets.DROPBOX_CLIENT_ID }}
DROPBOX_CLIENT_SECRET: ${{ secrets.DROPBOX_CLIENT_SECRET }}
NOTION_ACCESS_TOKEN: ${{ secrets.NOTION_ACCESS_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
ASANA_PAT: ${{ secrets.ASANA_PAT }}
ASANA_WORKSPACE_ID: ${{ secrets.ASANA_WORKSPACE_ID }}
jobs:
PullRequestTests:
# The type of runner that the job will run on
runs-on: ubuntu-24.04
# 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: 20.11.0
- name: Save release version to outputs
id: save_release_version
run: echo ::set-output name=version::$(node -pe "require('./package.json').version")
# Install App Catalogue dependencies
- name: Installing modules
id: install_modules
run: |
cd ts
yarn install
# Run App Catalogue build test
- name: Run build test
run: |
cd ts
yarn build:test
# Run App Catalogue unit tets
- name: Run unit tests
run: |
cd ts
yarn test:ci
# Install system dependencies needed for building Qore and modules
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
cmake \
pkg-config \
flex \
bison \
libmpfr-dev \
libpcre3-dev \
libssl-dev \
zlib1g-dev \
libbz2-dev \
doxygen \
libnode-dev \
libyaml-dev
# Clone the Qore repository and build it
- name: Clone and Build Qore
run: |
git clone https://github.com/qorelanguage/qore.git
cd qore
mkdir build
cd build
V8_INCLUDE_DIR=/usr/include/node cmake .. -DSINGLE_COMPILATION_UNIT=1 -DCMAKE_BUILD_TYPE=release
make && sudo make install
# Update library paths to ensure Qore can find its shared libraries
- name: Update Library Path
run: |
echo '/usr/local/lib' | sudo tee /etc/ld.so.conf.d/qore.conf
sudo ldconfig
# Verify Qore installation by checking the version
- name: Verify Qore Installation
run: qore --version
# Clone and build yaml-module
- name: Clone and build yaml module
run: |
git clone https://github.com/qorelanguage/module-yaml.git
cd module-yaml
mkdir build
cd build
cmake .. -DSINGLE_COMPILATION_UNIT=1 -DCMAKE_BUILD_TYPE=release
make && sudo make install
# Clone and build json-module
- name: Clone and build json-module
run: |
git clone https://github.com/qorelanguage/module-json.git
cd module-json
mkdir build
cd build
cmake .. -DSINGLE_COMPILATION_UNIT=1 -DCMAKE_BUILD_TYPE=release
make && sudo make install
# Build V8-module
- name: Build V8-module
run: |
mkdir build
cd build
cmake .. -DSINGLE_COMPILATION_UNIT=1 -DCMAKE_BUILD_TYPE=release
make && sudo make install
# Test catalogue actions made with schema
- name: Test catalogue actions
run: |
cd ts
yarn test-build && QORE_TYPESCRIPT_ACTION_SCRIPTS=./dist/index.js QORE_TYPESCRIPT_ACTION_TEST_SCRIPTS=./dist/index.js qore -l TypeScriptActionInterface -nX 1
# - name: Serve Storybook and run tests
# run: |
# npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
# "npx http-server storybook-static --port 6008 --silent" \
# "npx wait-on tcp:6008 && yarn test-storybook"
# - name: Publish to Chromatic
# id: chromatic_publish
# uses: chromaui/action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# exitZeroOnChanges: true
# allowConsoleErrors: true
# debug: true
# Notify Discord if Success
- name: Discord notification success
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*, install the canary version via `yarn add @qoretechnologies/qorus-actions-catalogue@${{ steps.bump.outputs.version }}`.'
if: success()
# Notify discord if failure
- name: Discord notification failure
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()