Skip to content

Commit

Permalink
Merge branch 'master' into test/lighthouse-action
Browse files Browse the repository at this point in the history
  • Loading branch information
tchalvak authored Mar 21, 2024
2 parents 8c66f13 + 6467e79 commit ea2e946
Show file tree
Hide file tree
Showing 2,334 changed files with 17,271 additions and 12,431 deletions.
3 changes: 2 additions & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ enabled = true
[analyzers.meta]
environment = [
"jquery",
"jest"
"jest",
"nodejs"
]

[[analyzers]]
Expand Down
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['react'],
Expand All @@ -30,15 +30,15 @@ module.exports = {
],
'max-lines': [
'error',
100,
103,
],
'max-lines-per-function': [
'error',
50,
53,
],
'max-statements': [
'error',
17,
23,
],
},
};
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
/.yarn/cache/** binary
/yarn.lock binary
/deploy/www/css/*.min.css binary
/deploy/www/js/*.min.js binary
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package.json @tchalvak
composer.json @tchalvak
yarn.lock @tchalvak
deploy/resources.template.php @tchalvak
deploy/resources.build.php @tchalvak
amplify.yml @tchalvak
amplify/ @tchalvak
Expand Down
7 changes: 3 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Purpose of PR:

> ---
-
-
-
>
## Before

## After

## For Non-Hotfixes:

## _Attached Screenshot of my change:_

## _Things that make review take longer:_
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/checks.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Functional Tests
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
cypress-run:
runs-on: ubuntu-latest
# Runs tests in parallel with matrix strategy https://docs.cypress.io/guides/guides/parallelization
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
# Also see warning here https://github.com/cypress-io/github-action#parallel
env:
CYPRESS_TEST_USERNAME: ${{ vars.CYPRESS_TEST_USERNAME }}
CYPRESS_TEST_FIRST_NAME: ${{ vars.CYPRESS_TEST_FIRST_NAME }}
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_TEST_PASSWORD: ${{ secrets.CYPRESS_TEST_PASSWORD }} # Secret, not env var
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
matrix:
containers: [1, 2] # Uses 2 parallel instances
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Chrome
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v6
with:
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
start: echo "No-op for now"
wait-on: 'http://www.ninjawars.net' # Waits for above
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: true
parallel: true # Runs test in parallel using settings above
env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111 changes: 58 additions & 53 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,67 @@
name: PHP Composer
name: PHP NW Run
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: '8.0'
extensions: mbstring, intl, pgsql, xml
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Validate composer.json and composer.lock
run: ./composer.phar validate

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: ./composer.phar install --prefer-dist --no-progress --no-suggest

- name: Create autoload file if necessary
if: steps.composer-cache.outputs.cache-hit == 'true'
run: |
ls -halt ./vendor/
./composer.phar dump-autoload
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: |
ln -s ./resources.build.php ./deploy/resources.php
./composer.phar run-script unit-test
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: "8.2.4"
extensions: mbstring, intl, pgsql, xml
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Validate composer.json and composer.lock
run: ./composer.phar validate

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies and create autoload
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
chmod ug+x ./configure
./configure
make create-structure
make preconfig
make link-vendor
make build
# ./composer.phar install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader
- name: Run unit test suite
run: |
ln -sf ./resources.build.php ./deploy/resources.php
./composer.phar run-script unit-test
- name: Run test-check suite
run: |
ln -sf ./resources.build.php ./deploy/resources.php
./composer.phar run-script test-checkbase
# make db-init-all
#./composer.phar run-script test-cron
20 changes: 15 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# ignore project specific files
deploy/resources.php

# ignore composer installed files
vendor/
vendor/*
deploy/vendor/*
deploy/vendor
deploy/www/js/jquery*
deploy/www/js/bootstrap*
deploy/www/css/bootstrap*
Expand All @@ -14,6 +18,14 @@ deploy/model/orm/*
!deploy/model/orm/.gitkeep
!deploy/sql/.gitkeep

# Static Built files
deploy/www/index.html
deploy/www/intro.html

# build artifacts
deploy/artifacts/
nw-artifact/

#ignore developer specific GNU make configuration for this project
CONFIG

Expand All @@ -23,9 +35,6 @@ CONFIG
unclean
archive

# ignore composer installed files
vendor/

# Ignore vim autogenerated files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
Expand Down Expand Up @@ -89,6 +98,7 @@ Icon
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# See https://github.com/yarnpkg/berry/issues/454

node_modules/

Expand All @@ -98,5 +108,5 @@ deploy/.env
karma.conf.js
.phpunit.result.cache
.php-cs-fixer.cache
deploy/www/index.html
deploy/www/intro.html
cypress/local.json
cypress.config.js
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.1
20.10.0
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'@PSR12' => true, // This contains a ton of rules here: https://mlocati.github.io/php-cs-fixer-configurator/#version:2.16|fixer:psr12
// 'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'braces' => [
Expand Down
1 change: 1 addition & 0 deletions .phpver
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.2.5
Loading

0 comments on commit ea2e946

Please sign in to comment.