Skip to content

Commit

Permalink
[stable-4.7] Rename master to main in workflows and docs (#4122)
Browse files Browse the repository at this point in the history
* Rename master to main in workflows and docs

and sometimes to stable-4.7 when it makes sense to prefer over main

No-Issue

* fix cypress cron branch, interval
  • Loading branch information
himdel authored Aug 31, 2023
1 parent e26ea98 commit e63520f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Automerge

on:
pull_request_target:
branches: [ 'master', 'stable-*', 'feature/*' ]
branches: [ 'main', 'stable-*', 'feature/*' ]

jobs:
automerge:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
# allow running manually
workflow_dispatch:
pull_request:
branches: [ 'master', 'stable-*', 'feature/*' ]
branches: [ 'main', 'stable-*', 'feature/*' ]
push:
branches: [ 'master', 'stable-*', 'feature/*' ]
# daily on master
branches: [ 'main', 'stable-*', 'feature/*' ]
# weekly on stable-4.7
schedule:
- cron: '30 5 * * *'
- cron: '30 5 * * 1'

concurrency:
group: cypress-${{ github.ref }}
Expand All @@ -19,8 +19,8 @@ jobs:
cypress:
runs-on: ubuntu-latest
env:
# base of a PR, or pushed-to branch outside PRs, or master
BRANCH: ${{ github.base_ref || github.ref || 'refs/heads/master' }}
# base of a PR, or pushed-to branch outside PRs, or stable-4.7
BRANCH: ${{ github.base_ref || github.ref || 'refs/heads/stable-4.7' }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -55,8 +55,8 @@ jobs:
- name: "Set variables for screenshots"
if: matrix.test == 'screenshots'
run: |
UI_COMMIT_MASTER=`curl -s https://api.github.com/repos/ansible/ansible-hub-ui/branches/${SHORT_BRANCH} | jq -r .commit.sha`
echo "UI_COMMIT_MASTER=${UI_COMMIT_MASTER}" >> $GITHUB_ENV
UI_COMMIT_MAIN=`curl -s https://api.github.com/repos/ansible/ansible-hub-ui/branches/${SHORT_BRANCH} | jq -r .commit.sha`
echo "UI_COMMIT_MAIN=${UI_COMMIT_MAIN}" >> $GITHUB_ENV
COMPARE_SCREENSHOTS=${{ github.event_name == 'pull_request' }}
echo 'compare screenshots:'
Expand Down Expand Up @@ -182,12 +182,12 @@ jobs:
run: |
diff -Naur <(ls test/cypress/e2e) <(yq '.jobs.cypress.strategy.matrix.test[]' .github/workflows/cypress.yml | sort)
- name: "Cache master screenshots"
- name: "Cache original screenshots"
if: matrix.test == 'screenshots'
uses: actions/cache@v3
with:
path: ansible-hub-ui/test/screenshots-main/
key: screenshots-${{env.SHORT_BRANCH}}-${{ env.UI_COMMIT_MASTER }}
key: screenshots-${{env.SHORT_BRANCH}}-${{ env.UI_COMMIT_MAIN }}
restore-keys: |
screenshots-${{env.SHORT_BRANCH}}-
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
exit 1
fi
- name: "Move Cache master screenshots"
- name: "Move cached screenshots"
if: ${{ matrix.test == 'screenshots' && env.COMPARE_SCREENSHOTS == 'false' }}
working-directory: 'ansible-hub-ui/test'
run: |
Expand Down
22 changes: 1 addition & 21 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,10 @@ name: "PR checks"

on:
pull_request:
branches: [ 'master', 'stable-*', 'feature/*' ]
branches: [ 'main', 'stable-*', 'feature/*' ]

jobs:

check_commit:
runs-on: ubuntu-latest
if: ${{ github.base_ref == 'master' }}
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
fetch-depth: 0 # include all history

- name: Run script to validate commits for both pull request and a push
env:
GITHUB_PR_COMMITS_URL: ${{ github.event.pull_request.commits_url }}
GITHUB_USER: ${{ github.event.pull_request.user.login }}
START_COMMIT: ${{ github.event.before }}
END_COMMIT: ${{ github.event.after }}
run: |
curl https://raw.githubusercontent.com/ansible/galaxy_ng/master/.ci/scripts/validate_commit_message_custom.py | python
pr-checks:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ The app will run on http://localhost:8002/ui and proxy requests for `/api/automa

## UI Testing

For more information about UI testing go to [test README](https://github.com/ansible/ansible-hub-ui/tree/master/test/README.md).
For more information about UI testing go to [test README](https://github.com/ansible/ansible-hub-ui/tree/stable-4.7/test/README.md).
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ name like `$collection-form.js`
name like `$collection-$action.js` (using camel\_case for both collection name and action name)

* test the action on each available screen
* prefer to loop the same test over an array of "get me there" functions (see [`execution_environments_use_in_controller.js`](https://github.com/ansible/ansible-hub-ui/blob/master/test/cypress/integration/execution_environments_use_in_controller.js#L53-L83) for an example)
* prefer to loop the same test over an array of "get me there" functions (see [`execution_environments_use_in_controller.js`](https://github.com/ansible/ansible-hub-ui/blob/stable-4.7/test/cypress/integration/execution_environments_use_in_controller.js#L53-L83) for an example)
* make sure to wait until every request associated with submitting that action ends, including tasks, and subsequent list screen reloads

## GalaxyKit Integration
Expand Down

0 comments on commit e63520f

Please sign in to comment.