Skip to content

Commit

Permalink
Version 1.0.2
Browse files Browse the repository at this point in the history
Version 1.0.2
  • Loading branch information
czemar authored Jan 12, 2023
2 parents 56425df + 78cf19f commit 000b37b
Show file tree
Hide file tree
Showing 37 changed files with 253 additions and 212 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/_app.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
- name: Build ⚙️
run: yarn build:${{ inputs.configuration }}

# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v2
# Cache results
- name: Cache results
uses: actions/cache@v3
with:
name: build-${{ inputs.configuration }}
path: dist
key: ${{ runner.os }}-build-${{ github.run_id }}
10 changes: 6 additions & 4 deletions .github/workflows/_app.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Download artifacts
- name: Download artifacts
uses: actions/download-artifact@v2
# Download cache
- name: Download cache
uses: actions/cache@v3
with:
name: build-${{ inputs.configuration }}
path: dist
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-
# Copy default redirect page
- name: Redirect page copy
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/_audit.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
- name: Audit build
run: yarn audit:build

# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v2
# Cache results
- name: Cache results
uses: actions/cache@v3
with:
name: audit-report
path: documentation/audit
key: ${{ runner.os }}-audit-build-${{ github.run_id }}

24 changes: 12 additions & 12 deletions .github/workflows/_badges.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ jobs:
- name: Install yarn
run: npm i -g yarn

# Download artifacts
- name: Download artifacts
uses: actions/download-artifact@v2
# Download docs from cache
- name: Download docs from cache
uses: actions/cache@v3
with:
name: documentation
path: documentation
key: ${{ runner.os }}-docs-build-${{ github.run_id }}

# Download artifacts
- name: Download artifacts
uses: actions/download-artifact@v2
# Download unit tests from cache
- name: Download unit tests from cache
uses: actions/cache@v3
with:
name: unit-tests
path: coverage
key: ${{ runner.os }}-unit-tests-${{ github.run_id }}

# Build badges
- name: Badges build
run: yarn badges:build

# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v2
# Cache results
- name: Cache results
uses: actions/cache@v3
with:
name: badges
path: badges
key: ${{ runner.os }}-badges-build-${{ github.run_id }}

12 changes: 5 additions & 7 deletions .github/workflows/_docs.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ jobs:
- name: Docs build
run: yarn docs:build:${{ inputs.configuration }}

# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v2
# Cache results
- name: Cache results
uses: actions/cache@v3
with:
name: documentation
path: |
documentation
documentation.json
path: documentation
key: ${{ runner.os }}-docs-build-${{ github.run_id }}

47 changes: 32 additions & 15 deletions .github/workflows/_docs.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy docs to GitHub Pages
on:
workflow_call:
inputs:
# Available options: dev, prod
configuration:
required: true
type: string
Expand All @@ -19,31 +20,47 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Download artifacts (storybook)
- name: Download artifacts (storybook)
uses: actions/download-artifact@v2
# Download cache (documentation)
- name: Download cache (documentation)
uses: actions/cache@v3
with:
name: documentation
path: ./
path: documentation
key: ${{ runner.os }}-docs-build-${{ github.run_id }}

# Download artifacts (coverage)
- name: Download artifacts (coverage)
uses: actions/download-artifact@v2
# Download cache (unit-tests)
- name: Download cache (unit-tests)
uses: actions/cache@v3
with:
name: unit-tests
path: documentation/coverage
path: coverage
key: ${{ runner.os }}-unit-tests-${{ github.run_id }}

# Download artifacts (audit report)
- name: Download artifacts (coverage)
uses: actions/download-artifact@v2
# Download cache (audit-report)
- name: Download cache (audit-report)
uses: actions/cache@v3
with:
name: audit-report
path: documentation/audit
key: ${{ runner.os }}-audit-build-${{ github.run_id }}

# Download cache (badges)
- name: Download cache (badges)
uses: actions/cache@v3
with:
path: badges
key: ${{ runner.os }}-badges-build-${{ github.run_id }}

# Copy unit tests to documentation directory
- name: Copy unit tests to documentation directory
run: cp -r coverage documentation/coverage

# Copy badges directory to documentation/assets
- name: Copy badges directory to documentation/assets
run: cp -r badges documentation/assets

# Get app version from package.json
- name: Get app version
id: get_version
run: echo VERSION=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV
run: >
echo VERSION=$(CONFIGURATION=${{ inputs.configuration }} node -p -e "process.env.CONFIGURATION == 'dev' ? 'dev' : require('./package.json').version") >> $GITHUB_ENV
# Deploy documentation to Github pages
- name: Deploy documentation 📄
Expand Down
118 changes: 4 additions & 114 deletions .github/workflows/_e2e.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,119 +28,9 @@ jobs:
yarn e2e:build
yarn e2e:coverage
# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v2
# Cache results
- name: Cache results
uses: actions/cache@v3
with:
name: e2e-tests
path: coverage



# deploy:
# runs-on: ubuntu-latest
# steps:
# # Default first step do checkout the repository
# - uses: actions/checkout@v3

# # Node js installation
# - name: Install Node.js version 16.x
# uses: actions/setup-node@v3
# with:
# node-version: '16.x'

# # Cache node modules
# - name: Cache node modules
# id: cache-node-modules
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules-yarn
# with:
# path: node_modules
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

# # Install yarn
# - name: Install yarn
# run: npm i -g yarn

# # Install dependencies
# - name: Install dependencies
# # if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
# run: yarn install

# # Build
# - name: Build ⚙️
# run: yarn build:dev

# # Run tests
# - name: Unit tests
# run: yarn unit:build

# # Copy default redirect page
# - name: Redirect page copy
# run: cp src/redirect.html dist/vernite/index.html

# # Deploy to the server using rsync
# - name: Deploy app 🚀
# uses: easingthemes/ssh-deploy@main
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# ARGS: '-rltgoDzvO --delete'
# SOURCE: './dist/vernite/'
# REMOTE_HOST: '51.83.255.98'
# REMOTE_PORT: '2224'
# REMOTE_USER: 'frontend'
# TARGET: '/var/www/html/dev'
# EXCLUDE: '/dist/, /node_modules/'

# # Run e2e tests
# - name: E2E tests
# run: yarn e2e:build

# # Build documentation and badges
# - name: Documentation
# run: |
# yarn docs:build
# yarn badges:build
# yarn analyze:build

# # Build audit report
# - name: Audit report
# run: |
# mkdir -p documentation/audit
# yarn audit:build

# # SonarQube scan
# # - uses: sonarsource/sonarqube-scan-action@master
# # env:
# # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# # SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

# # Copy coverage directory
# - name: Copy coverage directory
# run: |
# cp -R coverage/vernite documentation/coverage-unit
# cp -R coverage/vernite-e2e documentation/coverage-e2e

# # Deploy documentation to Github pages, TODO: add a condition to deploy different version of documentations
# - name: Deploy documentation 📄
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: documentation
# target-folder: dev
# clean-exclude: prod/

# # Deploy documentation index to Github pages
# - name: Deploy docs-pages
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: docs-pages
# clean-exclude: |
# dev/
# prod/
key: ${{ runner.os }}-e2e-tests-${{ github.run_id }}
15 changes: 7 additions & 8 deletions .github/workflows/_sonar.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Download artifacts
- name: Download artifacts
uses: actions/download-artifact@v2
# Download cache
- name: Download cache
uses: actions/cache@v3
with:
name: build-${{ inputs.configuration }}
path: dist
key: ${{ runner.os }}-build-${{ github.run_id }}

# Download artifacts (coverage)
- name: Download artifacts (coverage)
uses: actions/download-artifact@v2
- name: Download cache (unit-tests)
uses: actions/cache@v3
with:
name: unit-tests
path: coverage
key: ${{ runner.os }}-unit-tests-${{ github.run_id }}

# SonarQube scan
- uses: sonarsource/sonarqube-scan-action@master
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/_unit.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
- name: Unit tests
run: yarn unit:build

# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v2
# Cache results
- name: Cache results
uses: actions/cache@v3
with:
name: unit-tests
path: coverage
key: ${{ runner.os }}-unit-tests-${{ github.run_id }}

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<p align="center" style="color:red">
<img src="https://camo.githubusercontent.com/bb8c978f0a4b62e646273b8a5ea2ef05690184ae23d98109a0fc5cc5f450a6f8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616e67756c61722d6c6f76652d626c75653f6c6f676f3d616e67756c617226616e67756c61723d6c6f7665" />
<img src="https://vernite.github.io/frontend/prod/assets/badges/badge-tests-result.svg" />
<img src="https://vernite.github.io/frontend/prod/assets/badges/badge-coverage.svg" />
<img src="https://vernite.github.io/frontend/prod/assets/badges/badge-documentation.svg" />
<img src="https://vernite.github.io/frontend/dev/assets/badges/badge-tests-result.svg" />
<img src="https://vernite.github.io/frontend/dev/assets/badges/badge-coverage.svg" />
<img src="https://vernite.github.io/frontend/dev/assets/badges/badge-documentation.svg" />
<a href="https://codecov.io/gh/Vernite/frontend" >
<img src="https://codecov.io/gh/Vernite/frontend/branch/master/graph/badge.svg?token=QC0TRNLPL0"/>
</a>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vernite",
"version": "1.0.1",
"version": "1.0.2",
"scripts": {
"@------ WORKFLOW SCRIPTS --------": "",
"postinstall": "husky install",
Expand Down
9 changes: 5 additions & 4 deletions src/app/_main/decorators/cache/cache.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable, share, shareReplay } from 'rxjs';
import { Observable, share, shareReplay, EMPTY, from } from 'rxjs';

/**
* Options to modify caching behavior
Expand Down Expand Up @@ -28,11 +28,12 @@ export function Cache(options?: CacheOptions): MethodDecorator {
const cache = target[cacheKey];

if (cache) {
return cache;
// console.log('cache hit', target.constructor.name, cacheKey);
return from(cache);
}

const result = originalMethod.apply(this, args) as Observable<any>;
target[cacheKey] = result.pipe(share(), shareReplay(1));
const result = originalMethod.apply(this, args).pipe(shareReplay(1));
target[cacheKey] = result;

if (options && options.interval) {
setTimeout(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class AuditLogProjectEntriesPipe implements PipeTransform {
) {}

transform(auditLog: AuditLog<Task>) {
console.log('transform', auditLog);
if (auditLog.type === 'task') {
const user = auditLog.user;
const task = Object.assign(
Expand Down
Loading

0 comments on commit 000b37b

Please sign in to comment.