Open Dylan-Riley opened 3 years ago
Add all artillery and serverless-artillery actions to their own respective workflows?
Can serverless-artillery deploy a single time before doing all eight tests/invokes then do a single remove?
Which of the workflows depend on which other workflows?
Find previous issues/PRs for the deploy actions (UI/functions) see exactly what those do, how long they take.
Read up on https://github.com/softprops/turnstyle
Looks more like it's used to prevent the same action running in parallel from multiple merges, but it might do
Okay, so this is fairly simple using on: repository_dispatch (See here) BUT the workflows need to be in the default branch!
Using
name: foo
on: [push]
jobs:
workflow1:
name: workflow 1
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: wait fifteen seconds
run: |
echo foo
sleep 15
- name: Trigger next workflow
if: success()
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: ${{ github.repository }}
event-type: trigger-workflow-2
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
and
name: bar
on:
repository_dispatch:
types: [trigger-workflow-2]
jobs:
workflow2:
name: workflow 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.sha }}
- run: echo bar
I was able to get a proof of concept, but multiple people testing any sweeping changes I make will not work
Therefore, I have decided only to edit the existing workflows as of 4/MAR/2021 to trigger each other sequentially. I will not be doing any of the extra edits suggested in https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/issues/195#issuecomment-785697435
I also needed to add a secret that is a github Personal Access Token in order to get all the permissions needed. All this token has access to is the repo and workflow scopes, everything else is not included
Previous Workflow Filename | Function | New Filename | Order |
---|---|---|---|
artillery-action-users-api.yml | test users function with artillery | artillery-users.yml | 3 |
artillery-action-users-id-tasks-id.yaml | test users/{user_id}/tasks/{task_id} function with artillery | artillery-users-user_id-tasks-task_id.yml | 6 |
artillery-test-users-user_id-tasks.yaml | test users/{user_id}/tasks function with artillery | artillery-users-user_id-tasks.yml | 5 |
artillerytest-performance-user.yml | Seemingly was supposed to be a slsart test, horribly broken | DELETED | N/A |
deploy-apis.yaml | deploy api functions | deploy-functions.yml | 2 |
deploy-ui.yml | deploy UI | deploy-ui.yml | 1 |
performancetest-users-userID.yaml | slsart test users/{user_id} (need to rename and move test script file) | slsart-api-users-user_id | 8 |
performancetest.yml | unspecified slsart test, would work but doesn't do anything | DELETED | N/A |
serverless-artillery-action-users-id-tasks-api.yml | (From https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/pull/175) slsart test users/{user_id}/tasks | slsart-api-users-user_id-tasks.yml | 9 |
serverless-artillery-test-users-api.yml | slsart test users | slsart-api-users.yml | 7 |
serverless-artilleryreport-users-user_id-tasks.yml | Old version of step 9, would have been removed with https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/pull/175 | DELETED | N/A |
sql-injection-post-users-userid-tasks.yml | SQL injection test? Not on my list | unchanged | last |
ui-tests-users.yaml | test the UI of users, not a slsart test | unchanged | tentative 11 |
Only ten working (presumably) workflows in /.github/workflows/ total, two of which aren't technically on my list.
Missing:
Order:
Many will need to be renamed, a few might need adjusting.
Preliminary research makes it seem there's not a super elegant way to make workflows wait on other workflows.From https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run :
Also try to figure out https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/issues/186