Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5039 from GCTC-NTGC/release/v1.2.7
Browse files Browse the repository at this point in the history
Release/v1.2.7
  • Loading branch information
yonikid15 authored Jan 25, 2021
2 parents 077d9b9 + 47b4235 commit b25be8f
Show file tree
Hide file tree
Showing 539 changed files with 46,028 additions and 23,143 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[
"react-intl",
{
"messagesDir": "./resources/assets/js/translations/extractedMessages"
"messagesDir": "./resources/assets/js/translations/extractedMessages",
"extractFromFormatMessageCall": true
}
],
"@babel/plugin-proposal-optional-chaining"
Expand Down
43 changes: 43 additions & 0 deletions .env.actions
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
APP_NAME="Talent Cloud"
APP_ENV=testing
APP_KEY="base64:lSoNWwEtogJWFNF7ryPiYyXeSdU4ked4NrhRDMvdUFE="
APP_DEBUG=false
APP_URL=https://localhost

APPLICANT_PREFIX=
MANAGER_PREFIX=manager
HR_PREFIX=hr

FORCE_ADMIN=false
DEBUGBAR_ENABLED=false
HIDE_LOCALE_IN_URL=false

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=testing
DB_USERNAME=talentcloud
DB_PASSWORD=talentcloud

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=database
SESSION_LIFETIME=120
QUEUE_DRIVER=database

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
ADMIN_EMAIL=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
173 changes: 173 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Tests

on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]

jobs:

phpunit:

runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.6-alpine
options: --name=postgres
env:
POSTGRES_DB: testing
POSTGRES_USER: talentcloud
POSTGRES_PASSWORD: talentcloud
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.2
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, bcmath, soap, intl, gd, exif, iconv, imagick
tools: composer:v1

- name: Copy .env
run: cp .env.actions .env

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
uses: MilesChou/composer-action/7.2/install@master
with:
args: install --no-interaction --prefer-dist --no-progress --no-suggest

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.15.1

- name: Install npm dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install

- name: Cache Npm packages
id: npm-cache
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Generate key
run: php artisan key:generate

- name: Directory Permissions
run: chmod -R 777 storage

- name: Generate certificates
run: make gen-certs

- name: Create Laravel storage symlink
run: php artisan storage:link

- name: Setup database
run: |
docker exec -d postgres psql -c 'create database testing with owner talentcloud;' -U talentcloud --no-password
php artisan migrate --seed
env:
DB_PORT: 5432
DB_HOST: localhost
DB_DATABASE: testing

- name: Compile webpack assets
run: npm run prod

- name: Run PHPUnit tests
run: vendor/bin/phpunit --coverage-clover=report/phpunit/coverage.xml --log-junit=report/phpunit/junit.phpunit.xml
env:
DB_PORT: 5432
DB_HOST: localhost
DB_DATABASE: testing

- name: Upload reports to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v1
with:
files: report/phpunit/coverage.xml,report/phpunit/junit.phpunit.xml
fail_ci_if_error: true

- name: Archive Laravel logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: laravel-logs
path: storage\logs\*.log

- name: Send Slack notification
uses: 8398a7/action-slack@v3
if: failure()
with:
status: ${{ job.status }}
author_name: ${{ github.actor }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

jest:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.15.1

- name: Cache Npm packages
id: npm-cache
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install npm dependencies
run: npm install

- name: Compile webpack assets
run: npm run prod

- name: Run Jest tests
run: npm run test -- -ci

- name: Upload reports to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v1
with:
files: report/jest/clover.xml,report/phpunit/junit.jest.xml
fail_ci_if_error: true

- name: Send Slack notification
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: ${{ github.actor }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
3 changes: 0 additions & 3 deletions .storybook/addons.js

This file was deleted.

8 changes: 8 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
stories: ['../**/*.stories.@(tsx)'],
addons: [
'@storybook/addon-knobs/register',
'@storybook/addon-actions/register',
'storybook-addon-intl/register',
]
}
24 changes: 2 additions & 22 deletions .storybook/config.ts → .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
import React from "react";
import { addParameters, configure, addDecorator } from "@storybook/react";
import { themes } from "@storybook/theming";
import { addDecorator } from "@storybook/react";
import { withKnobs } from "@storybook/addon-knobs";
import { setIntlConfig } from "storybook-addon-intl";
import messagesFr from "../resources/assets/js/translations/locales/fr.json";

// Add storybook knobs globally.
addDecorator(withKnobs);

// Option defaults.
addParameters({
options: {
theme: themes.light,
},
});

// automatically import all files ending in *.stories.tsx
const req = require.context(
"../resources/assets/js/stories",
true,
/\.stories\.tsx$/,
);

// Create a parent element for modals.
// Modals use the createPortal function, which needs a dom node passed in as a parent.
// That node needs to exist before the story file runs.
Expand All @@ -47,9 +33,3 @@ setIntlConfig({
getMessages,
textComponent: React.Fragment,
});

function loadStories() {
req.keys().forEach(req);
}

configure(loadStories, module);
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ branches:

jobs: # run test suites simultaneously
include:
- php: '7.2'
env: TEST_SUITE=jest
- php: '7.2'
env: TEST_SUITE=phpunit
- php: '7.2'
env: TEST_SUITE=browser
- env: TEST_SUITE=jest
- env: TEST_SUITE=phpunit
- env: TEST_SUITE=browser

env: # allow parallel makefile tasks
global:
Expand All @@ -48,7 +45,7 @@ before_install:
- phpenv config-rm xdebug.ini # remove xdebug
- sudo service postgresql stop # free port 5432
- travis_retry composer self-update # latest version of composer
- travis_retry npm i -g npm # latest version of npm
- travis_retry nvm install --lts # update container node version

install:
- cp .env.travis .env # environment variables
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fresh-db:
@docker exec talentcloud sh -c "php artisan migrate:fresh"

gen-certs:
@docker run --rm -v $(shell pwd)/etc/ssl:/certificates -e "SERVER=talent.test" jacoelho/generate-certificate
@docker run --rm -v $(shell pwd)/etc/ssl:/certificates -e "SERVER=localhost" jacoelho/generate-certificate

logs:
@docker-compose logs -f
Expand Down
Loading

0 comments on commit b25be8f

Please sign in to comment.