Skip to content

Commit

Permalink
Sync GitHub RWA to Bitbucket RWA repo; Add Bitbucket Pipelines (#771)
Browse files Browse the repository at this point in the history
* add sync bitbucket github action

* add bitbucket-pipelines.yml

* update with comment for develop branch

* sync on develop

* update to use build:ci

* sync on dev branch for the moment

* add timeout to windows cypress run

* bump to 40 min timeout
  • Loading branch information
Kevin Old committed Feb 23, 2021
1 parent 3412457 commit 45fa125
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 1 deletion.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ windows-workflow: &windows-workflow
post-steps:
- report-coverage
no-workspace: true
timeout: 30m

workflows:
linux:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ui-windows-tests:
timeout-minutes: 30
timeout-minutes: 40
runs-on: windows-2019
needs: install-windows
strategy:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/sync-bitbucket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This action mirrors the cypress-realworld-app github repo into a Bitbucket Repo
# github.com/cypress-io/cypress-realworld-app -> bitbucket.org/cypress-io/cypress-realworld-app

name: Sync Bitbucket over SSH

on:
push:
branches:
- kevin/bitbucket-pipelines-sync
- develop

# set the BB_REPO variable to the destination bitbucket workspace name
env:
BB_ROOT: [email protected]:cypress-io

jobs:
syncbb:
name: Synch from Github to Bitbucket using SSH
runs-on: ubuntu-latest
steps:
- name: Clone the github repo
uses: actions/checkout@v2

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.BITBUCKET_SSH_KEY }}
name: id_rsa # optional
known_hosts: ${{ secrets.BITBUCKET_KNOWN_HOSTS }}
config:
Host bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes

- uses: franzdiebold/github-env-vars-action@v2
- name: sync with bitbucket
run: |
cd $GITHUB_WORKSPACE
# update the entire repo including tags/branches; prune out deleted items
echo sync with $BB_ROOT/$CI_REPOSITORY_NAME
git fetch --prune --unshallow
# make the bitbucket repo a remote called sync
git remote add sync $BB_ROOT/$CI_REPOSITORY_NAME
# force push the sync remote with all changes.
git push --force --set-upstream -v --all sync
109 changes: 109 additions & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
image: cypress/browsers:node12.18.3-chrome87-ff82

api-tests: &api-tests
name: "API Tests"
caches:
- cypress
- node
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser chrome --group "API" --spec "cypress/tests/api/*" --ci-build-id $BITBUCKET_BUILD_NUMBER

ui-chrome-tests: &ui-chrome-tests
name: "UI Tests - Chrome"
caches:
- cypress
- node
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser chrome --group "UI - Chrome" --spec "cypress/tests/ui/*" --ci-build-id $BITBUCKET_BUILD_NUMBER

ui-chrome-tests-mobile: &ui-chrome-tests-mobile
name: "UI Tests - Chrome - Mobile"
caches:
- cypress
- node
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser chrome --group "UI - Chrome - Mobile" --spec "cypress/tests/ui/*" --ci-build-id $BITBUCKET_BUILD_NUMBER --config "viewportWidth=375,viewportHeight=667"

ui-firefox-tests: &ui-firefox-tests
name: "UI Tests - Firefox"
caches:
- cypress
- node
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser firefox --group "UI - Firefox" --spec "cypress/tests/ui/*" --ci-build-id $BITBUCKET_BUILD_NUMBER

ui-firefox-tests-mobile: &ui-firefox-tests-mobile
name: "UI Tests - Firefox - Mobile"
caches:
- cypress
- node
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser firefox --group "UI - Firefox - Mobile" --spec "cypress/tests/ui/*" --ci-build-id $BITBUCKET_BUILD_NUMBER --config "viewportWidth=375,viewportHeight=667"

pipelines:
default:
- step:
name: Install dependencies and build frontend application
caches:
- yarn
- cypress
- node
script:
- yarn install --frozen-lockfile
- yarn types
- yarn test:unit:ci
- yarn build:ci
artifacts:
- build/**
- parallel:
- step:
<<: *api-tests
- step:
<<: *ui-chrome-tests
- step:
<<: *ui-chrome-tests
- step:
<<: *ui-chrome-tests
- step:
<<: *ui-chrome-tests
- step:
<<: *ui-chrome-tests
- step:
<<: *ui-chrome-tests-mobile
- step:
<<: *ui-chrome-tests-mobile
- step:
<<: *ui-chrome-tests-mobile
- step:
<<: *ui-chrome-tests-mobile
- step:
<<: *ui-chrome-tests-mobile
- step:
<<: *ui-firefox-tests
- step:
<<: *ui-firefox-tests
- step:
<<: *ui-firefox-tests
- step:
<<: *ui-firefox-tests
- step:
<<: *ui-firefox-tests
- step:
<<: *ui-firefox-tests-mobile
- step:
<<: *ui-firefox-tests-mobile
- step:
<<: *ui-firefox-tests-mobile
- step:
<<: *ui-firefox-tests-mobile
- step:
<<: *ui-firefox-tests-mobile
definitions:
caches:
yarn: $HOME/.cache
cypress: $HOME/.cache/Cypress

0 comments on commit 45fa125

Please sign in to comment.