Added workflows to test github token

This commit is contained in:
jamelreid 2022-02-04 09:46:20 -05:00
parent 1a42791fba
commit 44826048bf
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,38 @@
name: Smoke test release test
on:
workflow_dispatch:
inputs:
release_id:
description: WooCommerce Release Id
required: true
jobs:
login-run:
name: Daily smoke test on release.
runs-on: ubuntu-18.04
steps:
- name: Checkout code.
uses: actions/checkout@v2
with:
path: package/woocommerce
- name: Fetch Asset ID
id: fetch_asset_id
uses: actions/github-script@v5
env:
RELEASE_ID: ${{ github.event.inputs.release_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
with:
script: |
const script = require( './package/woocommerce/.github/workflows/scripts/fetch-asset-id.js' )
await script({github, context, core})
- name: Download WooCommerce release zip
run: |
echo ${{ steps.fetch_asset_id.outputs.asset_id }}
curl -u ${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }} https://api.github.com/repos/${{ github.repository }}/releases/assets/${{ steps.fetch_asset_id.outputs.asset_id }} -LJOH 'Accept: application/octet-stream'
unzip woocommerce.zip -d woocommerce
ls woocommerce

View File

@ -0,0 +1,15 @@
name: Workflow Test
on: pull_request
jobs:
run-release-smoke-tests:
name: Run Smoke test release
runs-on: ubuntu-latest
steps:
- name: Invoke release smoke testing workflow
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: Smoke test release test
repo: ${{ github.repository }}
token: ${{ secrets.E2E_WORKFLOW_GH_TOKEN }}
ref: refs/heads/trunk
inputs: '{ "release_id": 58553226 }'