App Plugin smoke test (init, build and deploy) #938
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
name: App Plugin smoke test (init, build and deploy) | |
on: | |
workflow_dispatch: | |
schedule: | |
# run daily at midnight | |
- cron: '15 0 * * *' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 1 | |
matrix: | |
node-version: [18.x, 20.x] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup CLI | |
uses: actions/checkout@master | |
with: | |
repository: adobe/aio-cli-plugin-app | |
- name: Update package.json oclif.plugins | |
uses: jossef/[email protected] | |
with: | |
file: package.json | |
field: oclif.plugins | |
value: "[\"@adobe/aio-cli-plugin-app-templates\"]" | |
parse_json: true | |
- id: create | |
name: create app with no extensions | |
run: | | |
npm i @adobe/aio-cli-plugin-app-templates | |
npm i | |
mkdir ffapp | |
cd ffapp | |
../bin/run app:init . -y --no-login --standalone-app > consoleoutput.txt | |
grep "App initialization finished" consoleoutput.txt | |
echo AIO_RUNTIME_AUTH=${{secrets.RUNTIME_AUTH}} > .env | |
echo AIO_RUNTIME_NAMESPACE=${{secrets.RUNTIME_NAMESPACE}} >> .env | |
../bin/run app:deploy >> consoleoutput.txt | |
grep "Your deployed actions:" consoleoutput.txt | |
grep "api/v1/web/ffapp/generic" consoleoutput.txt | |
grep "/api/v1/web/ffapp/publish-events" consoleoutput.txt | |
grep ".adobeio-static.net/index.html" consoleoutput.txt | |
grep "Successful deployment" consoleoutput.txt | |
- id: app_pack | |
name: pack an app (uses previous created app) | |
run: | | |
cd ffapp | |
../bin/run app:pack &> consoleoutput.txt | |
grep "Packaging done." consoleoutput.txt | |
- id: app_install | |
name: install an app (uses previous packed app) | |
run: | | |
cd ffapp | |
../bin/run app:install dist/app.zip --output install-folder &> consoleoutput.txt | |
grep "Install done." consoleoutput.txt | |
- id: createext | |
name: create app with extension | |
run: | | |
rm -rf ffapp | |
mkdir ffapp | |
cd ffapp | |
../bin/run app:init . -y --no-login --extension dx/excshell/1 > consoleoutput.txt | |
grep "App initialization finished" consoleoutput.txt | |
echo AIO_RUNTIME_AUTH=${{secrets.RUNTIME_AUTH}} > .env | |
echo AIO_RUNTIME_NAMESPACE=${{secrets.RUNTIME_NAMESPACE}} >> .env | |
../bin/run app:deploy --no-publish >> consoleoutput.txt | |
grep "Your deployed actions:" consoleoutput.txt | |
grep "api/v1/web/dx-excshell-1/generic" consoleoutput.txt | |
grep ".adobeio-static.net/index.html" consoleoutput.txt | |
grep "Successful deployment" consoleoutput.txt | |
- id: output | |
name: Write the output to console for debugging | |
if: ${{ failure() }} | |
run: | | |
if [ -d "ffapp" ]; then cd ffapp; fi | |
cat consoleoutput.txt | |
- id: slacknotification | |
name: Slack Notification | |
if: ${{ failure() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_TITLE: 'Node version' | |
SLACK_MESSAGE: ${{ matrix.node-version }} | |
SLACK_COLOR: ${{ job.status == 'success' && 'good' || job.status == 'cancelled' && '#808080' || 'danger' }} |