Skip to content

Suites e2e

Suites e2e #39

Workflow file for this run

name: Automock E2E
on:
workflow_dispatch:
inputs:
target_branch:
description: 'E2E Target Branch'
required: true
jobs:
build:
name: Build, Prepare and Test
runs-on: ubuntu-latest
strategy:
matrix:
e2e-project: ['e2e/jest/nestjs', 'e2e/sinon/nestjs']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.target_branch }}
- name: Use Node 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Yarn
run: yarn --frozen-lockfile
- name: Build
run: yarn build
- name: Pack
run: lerna exec -- npm pack
- name: Move Tarballs
run: |
mkdir -p $PWD/${{ matrix.e2e-project }}/tarballs
lerna exec -- mv "*.tgz" $PWD/${{ matrix.e2e-project }}/tarballs
- name: Extract & Copy Tarballs
run: |
for file in ./tarballs/automock-*.tgz; do
[[ $file =~ automock-(.+)-[0-9]+\.[0-9]+\.[0-9]+\.tgz ]]
new_name="${BASH_REMATCH[1]}.tgz"
mv "$file" ${{ matrix.e2e-project }}/$new_name
done
working-directory: ${{ matrix.e2e-project }}
- name: Install Packages in E2E
run: npm install
working-directory: ${{ matrix.e2e-project }}
- name: Test e2e
run: npm run test
working-directory: ${{ matrix.e2e-project }}