Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Jan 29, 2023
0 parents commit 2db9772
Show file tree
Hide file tree
Showing 80 changed files with 71,763 additions and 0 deletions.
174 changes: 174 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
version: 2.1

defaults: &defaults
working_directory: ~/repo

jobs:
build:
<<: *defaults

docker:
- image: php:8.1

steps:
- checkout

- run:
name: Install dependencies
command: |
apt-get update -yqq
apt-get install -yqq git libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev libonig-dev libzip-dev nodejs
# Install PHP extensions
docker-php-ext-install mbstring pdo_pgsql curl intl gd xml zip bz2 opcache
# Install Composer
curl -sS https://getcomposer.org/installer | php
# Install NVM and Yarn
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm" && . "$NVM_DIR/nvm.sh" --no-use
nvm install && nvm use
npm install --global yarn
- run:
name: Validate and build composer packages
command: |
cd drupal && php ../composer.phar validate && php ../composer.phar install
# @TODO - Circle not seeing NPM
# - run:
# name: Install and build Nuxt
# command: |
# which npm
# cd nuxt && npm install && NUXT_TELEMETRY_DISABLED=1 npm run build

# - run:
# name: Install Codecov
# command: cd nuxt && yarn add codecov

- restore_cache:
keys:
- v1-dependencies-{{ checksum "drupal/composer.json" }}-{{ checksum "nuxt/package.json" }}
# fallback to using the latest cache if no exact match is found.
- v1-dependencies-

# - save_cache:
# paths:
# - drupal/vendor
# - nuxt/node_modules
# key: v1-dependencies-{{ checksum "drupal/composer.json" }}-{{ checksum "nuxt/package.json" }}

- persist_to_workspace:
root: ~/repo
paths:
- .

# lint:
# <<: *defaults
# steps:
# - attach_workspace:
# at: ~/repo

# - run:
# name: Run lint
# command: yarn lint --format ./node_modules/eslint-junit/index.js
# environment:
# ESLINT_JUNIT_OUTPUT: ./reports/junit/eslint.xml

# - run:
# name: Renovate config validator
# command: yarn lint:renovate

# - run:
# name: Bundlewatch
# command: yarn bundlewatch

# test_unit:
# <<: *defaults
# steps:
# - attach_workspace:
# at: ~/repo

# - run:
# name: Run unit tests
# command: yarn test:unit --reporters=jest-junit --runInBand
# environment:
# JEST_JUNIT_OUTPUT_DIR: ./reports/junit/
# NODE_OPTIONS: --max_old_space_size=8192

# - run:
# name: Upload coverage report
# command: yarn dlx codecov

# - store_test_results:
# path: ./reports/junit/

# - store_artifacts:
# path: ./reports/junit

test_e2e:
machine:
image: ubuntu-2004:2022.07.1
working_directory: ~/repo
environment:
DDEV_NONINTERACTIVE: "true"
steps:
- attach_workspace:
at: ~/repo

- run:
name: Install ddev
command: |
curl -LO https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh && bash install_ddev.sh
- run:
name: Setup .env
command: cp .env.example .env

- run:
name: Start server running
command: |
cd drupal && ddev start -y
- run:
name: Install Drupal
command: |
cd drupal && ddev drupal-install
- run:
name: Install cypress
command: npx cypress install

- run:
name: Run end-to-end tests
command: cd nuxt && npm run test:e2e

# - store_artifacts:
# path: ./examples/druxt-site/test/cypress/screenshots
# - store_artifacts:
# path: ./examples/druxt-site/test/cypress/videos

# - run:
# name: Run DruxtJS.org end-to-end tests
# command: yarn docs:test
# - store_artifacts:
# path: ./docs/nuxt/test/cypress/screenshots
# - store_artifacts:
# path: ./docs/nuxt/test/cypress/videos

workflows:
version: 2

build_test:
jobs:
- build
# - lint:
# requires:
# - build
# - test_unit:
# requires:
# - build
# - test_e2e:
# requires:
# - build
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASE_URL=http://quickstart-druxtsite.ddev.site
OAUTH_CLIENT_ID=2de21d20-7bca-4e31-a3d0-9f0445a79782
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Media**
If applicable, add screenshots or video to help explain your problem.

**Your Environment (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--- Provide a general summary of your changes in the title above -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (a non-breaking change which fixes an issue)
- [ ] New feature (a non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)


## Description
<!--- Describe your changes in detail -->
<!--- Why is this change required? What problem does it solve? -->
<!--- If it resolves an open issue, please link to the issue here. For example "Resolves: #1337" -->


## Screenshots/Media:
<!--- Add any screenshots or other type of media to demonstrate your change -->
93 changes: 93 additions & 0 deletions .github/workflows/test-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: test-preview

on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
test_preview:
runs-on: ubuntu-latest

steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@master

- name: Setup node env πŸ—
uses: actions/setup-node@v3.5.1
with:
node-version: 16
check-latest: true

- name: Update npm πŸ—
run: |
npm install -g npm
npm --version
- name: Cache node_modules πŸ“¦
uses: actions/cache@v3.0.11
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install frontend dependencies πŸ‘¨πŸ»β€πŸ’»
run: cd nuxt && npm install

- name: Lint code πŸ‘€
run: cd nuxt && npm run lint

- name: Create .env πŸ‘¨πŸ»β€πŸ’»
run: cp .env.example .env
- name: Setup ddev
uses: jonaseberle/github-action-setup-ddev@v1
with:
autostart: false
- name: Start ddev
run: cd drupal && ddev start
- name: Install Drupal πŸ‘¨πŸ»β€πŸ’»
run: cd drupal && ddev drupal-install

- name: Run unit tests πŸ§ͺ
run: cd nuxt && npm run test:unit

- name: Generate dist πŸ‘¨πŸ»β€πŸ’»
run: cd nuxt && NUXT_TARGET=static NUXT_TELEMETRY_DISABLED=1 npm run generate

- name: Run end-to-end tests πŸ§ͺ
run: cd nuxt && npm run test:e2e

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: './nuxt/dist'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
github-deployment-environment: ${{ github.head_ref }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1

- uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: nuxt/cypress/videos
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: nuxt/cypress/screenshots

- uses: codecov/codecov-action@v3
with:
files: ./nuxt/coverage/clover.xml
name: codecov-umbrella
fail_ci_if_error: true
verbose: true

0 comments on commit 2db9772

Please sign in to comment.