Skip to content

Workflow file for this run

name: Project Generator Tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
python-version: [3.7]
env:
generator-directory: ./packages/generator-volto
project-directory: ./my-volto-app
steps:
- uses: actions/checkout@v2
# node setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# node cache
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Build main Volto environment
- name: Build main Volto environment
run: yarn install --frozen-lockfile
# Generator own tests
- name: Generator tests
run: yarn && yarn test
working-directory: ${{env.generator-directory}}
# install Yeoman and the generator
- run: npm -g install yo
working-directory: ${{env.generator-directory}}
- run: npm -g install ./
working-directory: ${{env.generator-directory}}
# create a project
- run: yo @plone/volto my-volto-app --description "test volto project" --no-interactive
- name: Install yalc
run: npm -g install yalc
- name: Install a yalc'ed version of the current Volto in the project - publish
run: yalc publish
- name: Install a yalc'ed version of the current Volto in the project - add
run: yalc add @plone/volto --no-pure
working-directory: ${{env.project-directory}}
- name: Install a yalc'ed version of the current Volto in the project - install
run: yarn --force
working-directory: ${{env.project-directory}}
# Cypress install
- run: yarn cy:install
- name: Cypress acceptance tests
run: yarn ci:cypress:project:run
# Upload Cypress screenshots
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
# Upload Cypress videos
- uses: actions/upload-artifact@v1
if: always()
with:
name: cypress-videos
path: cypress/videos
- name: Test if npm packs correctly
run: npm pack --dry-run
if: success()
working-directory: ${{env.generator-directory}}