Skip to content

Commit

Permalink
fix(Actions): make create-app test work every time (#1518)
Browse files Browse the repository at this point in the history
* fix(Actions): make create-app test work every time
* fix(Actions): don't retrigger all tests on merge to main
* chore(Actions): update comment to reflect new reality
  • Loading branch information
SanderElias authored Jan 11, 2022
1 parent dc0ae5d commit c2ca4c8
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 45 deletions.
41 changes: 34 additions & 7 deletions .github/test-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:
uses: ./.github/build-artifacts
with:
node-version: ${{ inputs.node-version }}
- name : Test if angular builds using local packages
- name: Test if angular builds using local packages
env:
CI: true
NG_CLI_ANALYTICS: false false
Expand All @@ -29,26 +29,53 @@ runs:
npm pack dist/libs/ng-lib --quiet --silent
npm pack dist/libs/scully-plugin-puppeteer --quiet --silent
export scullyFolder=$PWD
echo "scullyFolder: $scullyFolder"
- name: create a new app
shell: bash
run: |
cd ..
rm ./demo -fr
echo "Create app with a couple of routes"
npx @angular/cli@${{ inputs.angular-version }} new demo --skip-git --routing --style css --minimal --strict
cd demo
npx ng update @angular/cli --migrate-only --from 12.0.0 --to 12.0.1 --allow-dirty
npx ng g m home --route home --module app.module
npx ng g m about --route about --module app.module
- name: install extra packages (rx, and the Scully using the local packages)
shell: bash
run: |
cd ../demo
echo "install deps"
npm i rxjs@7 --legacy-peer-deps --force --quiet --silent
echo "$scullyFolder"
cp $scullyFolder/*.tgz .
for f in *.tgz; do
echo "install package $f"
npm install $f --force --legacy-peer-deps --quiet --silent
cp ../scully/*.tgz .
for f in scullyio-scully-2*.tgz; do
echo "install package $f"
npm install $f --force --legacy-peer-deps --quiet --silent
done
for f in scullyio-scully-pl*.tgz; do
echo "install package $f"
npm install $f --force --legacy-peer-deps --quiet --silent
done
for f in scullyio-ng-lib*.*.tgz; do
echo "install package $f"
npm install $f --force --legacy-peer-deps --quiet --silent
done
for f in scullyio-init*.*.tgz; do
echo "install package $f"
npm install $f --force --legacy-peer-deps --quiet --silent
done
- name: run the ngAdd schematic
shell: bash
run: |
cd ../demo
echo "install Scully"
npx ng g @scullyio/init:ng-add --renderer puppeteer
npx ng g @scullyio/init:ng-add --renderer puppeteer
npx ng g @scullyio/init:blog
echo "build"
- name: build and run
shell: bash
run: |
cd ../demo
npx ng build
echo "run Scully"
npx scully --noPrompt
6 changes: 2 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Scully build, test, package, and deploy

on:
# Trigger the workflow on push or pull request,
# Trigger the workflow on any updates of the PR, but not on push to main.
# as that would only result in testing code that has just finnished testing
# but only for the main branch
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, labeled]

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ consoleProxy.ts
.angular
*.tgz
testCreate.sh
scully/runtime
Loading

0 comments on commit c2ca4c8

Please sign in to comment.