Skip to content

Merge pull request #129 from Making-Sense-Info/feat/random #193

Merge pull request #129 from Making-Sense-Info/feat/random

Merge pull request #129 from Making-Sense-Info/feat/random #193

Workflow file for this run

name: Trevas JS CI
on: [push]
jobs:
test-build:
name: Test & build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
# Build modules
- run: yarn build
# Build sonar reports
- run: yarn test --coverage
- name: Upload deploy artifact
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage/
sonarcloud:
runs-on: ubuntu-latest
needs: test-build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download coverage artifact
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build-assets:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: sonarcloud
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
# Build modules
- run: yarn build
# Build Storybook
- run: yarn build-storybook
- run: mkdir -p deploy/storybook
- run: cp -R ./built-storybook/storybook/. ./deploy/storybook
# Build bundle reports
- run: yarn analyze
- run: mkdir -p deploy/bundle-report
- run: cp -a ./packages/vtl-2.0-antlr-tools/bundle-report/. ./deploy/bundle-report
- run: cp -a ./packages/trevas/bundle-report/. ./deploy/bundle-report
- uses: actions/setup-node@v3
with:
# Because of gitbook support
node-version: 10
- run: |
npm i -g gitbook-cli
gitbook install
gitbook build
working-directory: ./docs/
- run: cp -a ./docs/_book/. ./deploy/
- name: Upload deploy artifact
uses: actions/upload-artifact@v3
with:
name: deploy
path: deploy/
deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build-assets
steps:
- name: Download deploy artifact
uses: actions/download-artifact@v3
with:
name: deploy
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .