Skip to content

Commit 01a6d87

Browse files
authored
Merge pull request #1 from qoretechnologies/initial-setup
Initial Setup
2 parents eacba71 + 84c8ad1 commit 01a6d87

File tree

213 files changed

+4075
-54370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+4075
-54370
lines changed

.github/workflows/beta_release.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -29,44 +29,50 @@ jobs:
2929
with:
3030
fetch-depth: 0
3131
ref: ${{ github.event.pull_request.head.sha }}
32+
3233
# Get commit message
3334
- name: Print head git commit message
3435
id: get_head_commit_message
3536
run: echo "::set-output name=HEAD_COMMIT_MESSAGE::$(git show -s --format=%s)"
37+
3638
- uses: actions/setup-node@v3
3739
with:
38-
node-version: 16
40+
node-version: 20.11.0
41+
3942
- name: Save release version to outputs
4043
id: save_release_version
4144
run: echo ::set-output name=version::$(node -pe "require('./package.json').version")
42-
- name: Preparing environment
43-
id: setup_environment
44-
run: npm install -g yarn
45+
4546
- name: Installing modules
4647
id: install_modules
4748
run: |
4849
yarn cache clean
4950
rm -rf node_modules
5051
yarn install
52+
5153
- name: Running tests
5254
id: tests
5355
run: yarn test:ci
56+
5457
- name: Build
5558
id: build
5659
run: yarn build
60+
5761
- name: Publish to NPM
5862
id: npm_publish
5963
uses: JS-DevTools/npm-publish@v1
6064
with:
6165
token: ${{ secrets.NPM_TOKEN }}
6266
tag: beta
6367
access: public
68+
6469
- name: Publish to Chromatic
6570
id: chromatic_publish
6671
uses: chromaui/action@v1
6772
with:
6873
token: ${{ secrets.GITHUB_TOKEN }}
6974
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
75+
7076
- name: Create a release
7177
id: release
7278
uses: actions/create-release@v1
@@ -78,6 +84,7 @@ jobs:
7884
body: v${{ steps.save_release_version.outputs.version }}
7985
draft: false
8086
prerelease: false
87+
8188
# Notify discord if success
8289
- name: Discord notification
8390
env:
@@ -86,8 +93,9 @@ jobs:
8693
DISCORD_AVATAR: 'https://github.com/qoretechnologies/reqore/blob/ae8ce24b7f0984340bf4e6835025d203d1741b3a/public/q-symbol-small.png?raw=true'
8794
uses: Ilshidur/action-discord@0.3.2
8895
with:
89-
args: ':white_check_mark: ReQore beta v${{ steps.save_release_version.outputs.version }} successfuly released & published.'
96+
args: ':white_check_mark: ReQraft beta v${{ steps.save_release_version.outputs.version }} successfuly released & published.'
9097
if: success()
98+
9199
# Notify discord if failure
92100
- name: Discord notification
93101
env:
@@ -96,5 +104,5 @@ jobs:
96104
DISCORD_AVATAR: 'https://github.com/qoretechnologies/reqore/blob/ae8ce24b7f0984340bf4e6835025d203d1741b3a/public/q-symbol-small.png?raw=true'
97105
uses: Ilshidur/action-discord@0.3.2
98106
with:
99-
args: ':exclamation: ReQore beta v${{ steps.save_release_version.outputs.version }} release failed! Click the GitHub Action link below to find out why.'
107+
args: ':exclamation: ReQraft beta v${{ steps.save_release_version.outputs.version }} release failed! Click the GitHub Action link below to find out why.'
100108
if: failure()

.github/workflows/tests.yml

+69-33
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,120 @@
11
# This is a basic workflow to help you get started with Actions
22

3-
name: Tests
3+
name: Pull Request Tests
44

55
# Controls when the action will run. Triggers the workflow on push or pull request
66
# events but only for the develop branch
77
on:
88
pull_request:
99
branches:
1010
- develop
11-
- main
1211

1312
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1413
jobs:
15-
Tests:
14+
PullRequestTests:
1615
# The type of runner that the job will run on
1716
runs-on: ubuntu-latest
18-
17+
env:
18+
QORUS_TOKEN: ${{ secrets.QORUS_TOKEN }}
1919
# Steps represent a sequence of tasks that will be executed as part of the job
2020
steps:
21-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
# Get current time for the commit
2222
- name: Get current time
2323
uses: josStorer/get-current-time@v2.0.2
2424
id: current_time
2525
with:
2626
format: YYYYMMDD-HH
2727
utcOffset: '+01:00'
28-
# Checkout the repo
29-
- uses: actions/checkout@v3
28+
29+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
30+
- name: Get repo
31+
uses: actions/checkout@v3
3032
with:
31-
fetch-depth: 0
3233
ref: ${{ github.event.pull_request.head.sha }}
33-
# Get commit message
34+
fetch-depth: 0
35+
3436
- name: Print head git commit message
3537
id: get_head_commit_message
3638
run: echo "::set-output name=HEAD_COMMIT_MESSAGE::$(git show -s --format=%s)"
39+
3740
- uses: actions/setup-node@v3
3841
with:
39-
node-version: 16
40-
- name: Preparing environment
41-
id: setup_environment
42-
run: npm install -g yarn
42+
node-version: 20.11.0
43+
44+
# Notify Discord to not restart server
45+
- name: Discord Warning
46+
env:
47+
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK_DEV}}
48+
# Mention someone in the embeds
49+
DISCORD_EMBEDS: '[{ "color":16711680, "description": ":exclamation: Tests started, **please do not restart Qorus on Rippy** for the next 30 minutes." }]'
50+
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
51+
uses: Ilshidur/action-discord@0.3.2
52+
with:
53+
args: '<@820316067921395752>'
54+
55+
- name: Save release version to outputs
56+
id: save_release_version
57+
run: echo ::set-output name=version::$(node -pe "require('./package.json').version")
58+
4359
- name: Installing modules
4460
id: install_modules
4561
run: |
46-
yarn cache clean
47-
rm -rf node_modules
4862
yarn install
49-
- name: Running tests
50-
id: tests
51-
run: yarn test:ci
52-
- name: Build test
53-
id: build_test
63+
yarn install-playwright
64+
yarn build-storybook --quiet
65+
66+
- name: Run build test
67+
run: |
68+
yarn build:test:prod
69+
70+
- name: Run unit tests
5471
run: |
55-
yarn build
56-
rm -rf dist
72+
yarn test:ci
73+
74+
- name: Serve Storybook and run tests
75+
run: |
76+
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
77+
"npx http-server storybook-static --port 6008 --silent" \
78+
"npx wait-on tcp:6008 && yarn test-storybook"
79+
5780
- name: Publish to Chromatic
5881
id: chromatic_publish
5982
uses: chromaui/action@v1
6083
with:
6184
token: ${{ secrets.GITHUB_TOKEN }}
6285
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
6386
exitZeroOnChanges: true
64-
- name: Save release version to outputs
65-
id: save_release_version
66-
run: echo ::set-output name=version::$(node -pe "require('./package.json').version")
67-
- name: Discord notification
87+
allowConsoleErrors: true
88+
debug: true
89+
90+
# Notify Discord if Success
91+
- name: Discord notification success
6892
env:
6993
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}}
70-
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}}) 📙 [Documentation](${{ steps.chromatic_publish.outputs.storybookUrl }}) 🎨 [Chromatic Tests](${{ steps.chromatic_publish.outputs.buildUrl }})"}],"color": 65280,"footer": { "text": "Published at ${{steps.current_time.outputs.readableTime}}" }}]'
71-
DISCORD_AVATAR: 'https://github.com/qoretechnologies/reqore/blob/ae8ce24b7f0984340bf4e6835025d203d1741b3a/public/q-symbol-small.png?raw=true'
94+
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}}) 🌐 [View Site]( https://deploy-preview-${{ github.event.pull_request.number}}--magical-starburst-a8bdfc.netlify.app) 📙 [Storybook](${{ steps.chromatic_publish.outputs.storybookUrl }}) 🎨 [Chromatic Tests](${{ steps.chromatic_publish.outputs.buildUrl }})"}],"color":65280,"footer":{"text": "Published at ${{steps.current_time.outputs.readableTime}}"}}]'
95+
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
7296
uses: Ilshidur/action-discord@0.3.2
7397
with:
74-
args: ':white_check_mark: Tests action run #${{ github.run_number }} for [PR](${{ github.event.pull_request.html_url }}) triggered by ${{ github.triggering_actor }} succeeded. Check the links below for potentional Storybook and Chromatic updates.'
98+
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.'
7599
if: success()
76-
- name: Discord notification
100+
101+
# Notify discord if failure
102+
- name: Discord notification failure
77103
env:
78104
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}}
79-
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": "Triggered at ${{steps.current_time.outputs.readableTime}}" }}]'
80-
DISCORD_AVATAR: 'https://github.com/qoretechnologies/reqore/blob/ae8ce24b7f0984340bf4e6835025d203d1741b3a/public/q-symbol-small.png?raw=true'
105+
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}}"}}]'
106+
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
81107
uses: Ilshidur/action-discord@0.3.2
82108
with:
83-
args: ':exclamation: Tests action run #${{ github.run_number }} for [PR](${{ github.event.pull_request.html_url }}) triggered by ${{ github.triggering_actor }} failed! Click the GitHub action link below to find out why.'
109+
args: ':exclamation: Tests run #${{ github.run_number }} for [PR](${{ github.event.pull_request.html_url }}) triggered by ${{ github.triggering_actor }} *failed*!'
84110
if: failure()
111+
112+
- name: Discord notification safe to restart
113+
env:
114+
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK_DEV}}
115+
DISCORD_EMBEDS: '[{ "color":65280, "description": ":white_check_mark: Tests action finished. It is now safe to restart Qorus on Rippy." }]'
116+
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
117+
uses: Ilshidur/action-discord@0.3.2
118+
with:
119+
args: '<@820316067921395752>'
120+
if: always()

.gitpod.yml

-11
This file was deleted.

.jest-test-results.json

-1
This file was deleted.

.storybook/main.js

-18
This file was deleted.

.storybook/main.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export default {
2+
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
3+
4+
addons: [
5+
'@storybook/addon-links',
6+
'@storybook/addon-essentials',
7+
'@storybook/addon-interactions',
8+
'@storybook/addon-webpack5-compiler-babel',
9+
'@chromatic-com/storybook',
10+
],
11+
12+
framework: {
13+
name: '@storybook/react-webpack5',
14+
options: {},
15+
},
16+
17+
features: {
18+
interactionsDebugger: true,
19+
},
20+
21+
typescript: { reactDocgen: 'react-docgen' },
22+
23+
refs: {
24+
reqore: {
25+
title: 'ReQore',
26+
url: 'https://reqore.qoretechnologies.com/',
27+
},
28+
},
29+
};

.storybook/manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from '@storybook/addons';
1+
import { addons } from '@storybook/manager-api';
22
import theme from './theme';
33

44
addons.setConfig({

0 commit comments

Comments
 (0)