-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add nvm config * chore(#81): add poc ci config files * chore: add github workflow * chore: update project * chore: target static * chore: remove lint job * chore: add .env step * chore: disable tests * chore: update .env.example * chore: disable nuxt install in circle * chore: add linting * chore: add unit tests * chore: add end-to-end tests * chore: disable circle e2e job * chore(#81): cypress for gitpod * chore(#81): update nuxt config and tests * chore(#81): add cypress install to dockerfile
- Loading branch information
Showing
25 changed files
with
23,530 additions
and
8,626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
BASE_URL=http://drupal.ddev.site | ||
BASE_URL=http://quickstart-druxtsite.ddev.site | ||
OAUTH_CLIENT_ID=2de21d20-7bca-4e31-a3d0-9f0445a79782 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: test-preview | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
test_preview: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [16] | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@master | ||
|
||
- name: Setup node env 🏗 | ||
uses: actions/setup-node@v3.4.1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
check-latest: true | ||
|
||
- name: Update npm 🏗 | ||
run: | | ||
npm install -g npm | ||
npm --version | ||
- name: Cache node_modules 📦 | ||
uses: actions/cache@v3.0.8 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
stages: | ||
- build | ||
- test | ||
|
||
cache: | ||
paths: | ||
- drupal/vendor/ | ||
|
||
build: | ||
stage: build | ||
image: php:7.4 | ||
before_script: | ||
- 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 | ||
|
||
script: | ||
# Validate and build composer packages | ||
- cd drupal && php composer.phar validate && php composer.phar install | ||
|
||
# Install and build Nuxt | ||
- cd ../nuxt && npm install && npm run build | ||
artifacts: | ||
paths: | ||
- drupal/web | ||
|
||
test_e2e: | ||
stage: test | ||
image: drud/ddev-gitpod-base:20220817 | ||
dependencies: | ||
- build | ||
services: | ||
- name: docker:dind | ||
alias: dockerdaemon | ||
variables: | ||
DOCKER_HOST: tcp://dockerdaemon:2375/ | ||
DOCKER_DRIVER: overlay2 | ||
DOCKER_TLS_CERTDIR: "" | ||
before_script: | ||
- sudo chown -R gitpod:gitpod . | ||
script: | ||
# Start DDev and install the Drupal backend. | ||
- cd drupal && ddev start -y && ddev drupal-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c455d71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Deployed on https://6334ec0efb7b06194be879dc--quickstart-druxt-site.netlify.app