Skip to content

Suites e2e

Suites e2e #38

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.node-version }}/tarballs
lerna exec -- mv "*.tgz" $PWD/${{ matrix.node-version }}/tarballs
- name: Extract & Copy Tarballs
run: |
for file in ./tarballs/*.tgz; do
newname=$(echo "$file" | sed -E 's/automock-|-[0-9]+\.[0-9]+\.[0-9]+//g' | sed 's/\.tgz$//')
mkdir -p "$newname"
tar --wildcards -xzvf "$file" -C "$newname" --no-same-owner --strip-components=1 "package/*"
done
working-directory: ${{ matrix.node-version }}
- name: Install Packages in E2E (${{ matrix.node-version }})
run: npm install
working-directory: ${{ matrix.node-version }}
- name: Test e2e
run: npm run test
working-directory: ${{ matrix.node-version }}