Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3021: Reduce CI runtime #3022

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 52 additions & 59 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ parameters:
- web_promotion
- delivery
- e2e_tests
- native_browserstack
- none
type: enum
version: 2.1
Expand All @@ -1082,20 +1083,6 @@ workflows:
- check:
context:
- mattermost
- build_web:
build_config_name: integreat-test-cms
context:
- mattermost
name: build_ig_test_cms_web
requires:
- bump_version
- check
- e2e_web:
context:
- mattermost
requires:
- bump_version
- check
unless:
or:
- equal:
Expand Down Expand Up @@ -1146,40 +1133,6 @@ workflows:
- build_malte_test_cms_web
- build_aschaffenburg_web
- build_obdach_web
- build_android:
build_config_name: integreat-test-cms
context:
- mattermost
- credentials-repo
- credentials-integreat
name: build_ig_test_cms_android
requires:
- bump_version
- upload_browserstack:
context:
- mattermost
- browserstack
file_name: integreat-test-cms.apk
name: upload_ig_test_cms_android_browserstack
requires:
- build_ig_test_cms_android
- build_ios:
build_config_name: integreat-test-cms
context:
- mattermost
- tuerantuer-apple
- fastlane-match
name: build_ig_test_cms_ios
requires:
- bump_version
- upload_browserstack:
context:
- mattermost
- browserstack
file_name: integreat-test-cms.ipa
name: upload_ig_test_cms_ios_browserstack
requires:
- build_ig_test_cms_ios
when:
and:
- equal:
Expand Down Expand Up @@ -1507,17 +1460,11 @@ workflows:
requires:
- build_e2e_ios
when:
or:
- and:
- << pipeline.parameters.api_triggered >>
- equal:
- << pipeline.parameters.workflow_type >>
- e2e_tests
- and:
- equal:
- main
- << pipeline.git.branch >>
- not: << pipeline.parameters.api_triggered >>
and:
- << pipeline.parameters.api_triggered >>
- equal:
- << pipeline.parameters.workflow_type >>
- e2e_tests
native_beta_delivery:
jobs:
- bump_version:
Expand Down Expand Up @@ -1725,6 +1672,52 @@ workflows:
- equal:
- << pipeline.parameters.workflow_type >>
- native_beta_delivery
native_browserstack:
jobs:
- bump_version:
context:
- mattermost
prepare_delivery: false
- build_android:
build_config_name: integreat-test-cms
context:
- mattermost
- credentials-repo
- credentials-integreat
name: build_ig_test_cms_android
requires:
- bump_version
- upload_browserstack:
context:
- mattermost
- browserstack
file_name: integreat-test-cms.apk
name: upload_ig_test_cms_android_browserstack
requires:
- build_ig_test_cms_android
- build_ios:
build_config_name: integreat-test-cms
context:
- mattermost
- tuerantuer-apple
- fastlane-match
name: build_ig_test_cms_ios
requires:
- bump_version
- upload_browserstack:
context:
- mattermost
- browserstack
file_name: integreat-test-cms.ipa
name: upload_ig_test_cms_ios_browserstack
requires:
- build_ig_test_cms_ios
when:
and:
- << pipeline.parameters.api_triggered >>
- equal:
- << pipeline.parameters.workflow_type >>
- native_browserstack
native_production_delivery:
jobs:
- bump_version:
Expand Down
1 change: 1 addition & 0 deletions .circleci/src/@common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ parameters:
web_promotion,
delivery,
e2e_tests,
native_browserstack,
none,
]
default: none
16 changes: 0 additions & 16 deletions .circleci/src/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,3 @@ jobs:
- check:
context:
- mattermost

- build_web:
name: build_ig_test_cms_web
build_config_name: integreat-test-cms
requires:
- bump_version
- check
context:
- mattermost

- e2e_web:
requires:
- bump_version
- check
context:
- mattermost
36 changes: 0 additions & 36 deletions .circleci/src/workflows/commit_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,39 +46,3 @@ jobs:
- build_malte_test_cms_web
- build_aschaffenburg_web
- build_obdach_web

- build_android:
name: build_ig_test_cms_android
build_config_name: integreat-test-cms
context:
- mattermost
- credentials-repo
- credentials-integreat
requires:
- bump_version
- upload_browserstack:
name: upload_ig_test_cms_android_browserstack
file_name: integreat-test-cms.apk
context:
- mattermost
- browserstack
requires:
- build_ig_test_cms_android

- build_ios:
name: build_ig_test_cms_ios
build_config_name: integreat-test-cms
context:
- mattermost
- tuerantuer-apple
- fastlane-match
requires:
- bump_version
- upload_browserstack:
name: upload_ig_test_cms_ios_browserstack
file_name: integreat-test-cms.ipa
context:
- mattermost
- browserstack
requires:
- build_ig_test_cms_ios
10 changes: 3 additions & 7 deletions .circleci/src/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
when:
or:
- and:
- << pipeline.parameters.api_triggered >>
- equal: [<< pipeline.parameters.workflow_type >>, e2e_tests]
- and:
- equal: [main, << pipeline.git.branch >>]
- not: << pipeline.parameters.api_triggered >>
and:
- << pipeline.parameters.api_triggered >>
- equal: [<< pipeline.parameters.workflow_type >>, e2e_tests]
jobs:
- bump_version:
prepare_delivery: false
Expand Down
45 changes: 45 additions & 0 deletions .circleci/src/workflows/native_browserstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
when:
and:
- << pipeline.parameters.api_triggered >>
- equal: [<< pipeline.parameters.workflow_type >>, native_browserstack]
jobs:
- bump_version:
context:
- mattermost
prepare_delivery: false

- build_android:
name: build_ig_test_cms_android
build_config_name: integreat-test-cms
context:
- mattermost
- credentials-repo
- credentials-integreat
requires:
- bump_version
- upload_browserstack:
name: upload_ig_test_cms_android_browserstack
file_name: integreat-test-cms.apk
context:
- mattermost
- browserstack
requires:
- build_ig_test_cms_android

- build_ios:
name: build_ig_test_cms_ios
build_config_name: integreat-test-cms
context:
- mattermost
- tuerantuer-apple
- fastlane-match
requires:
- bump_version
- upload_browserstack:
name: upload_ig_test_cms_ios_browserstack
file_name: integreat-test-cms.ipa
context:
- mattermost
- browserstack
requires:
- build_ig_test_cms_ios
42 changes: 21 additions & 21 deletions docs/cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@

Several workflows exist for different purposes:

| Workflow | Schedule/Trigger | Checks | native delivery | web delivery | Version bump | Move release notes |
| -------------------------- | ---------------------- | ------------------ | --------------- | ------------ | ------------------ | ------------------ |
| commit | commits of PRs | :heavy_check_mark: | :x: | :x: | :x: | :x: |
| commit_main | commits on main | :x: | browserstack | webnext | :x: | :x: |
| delivery | Monday (04:00), script | :heavy_check_mark: | beta | beta | :heavy_check_mark: | :heavy_check_mark: |
| native_promotion | Monday (02:00), script | :x: | promotion | :x: | :x: | :x: |
| web_promotion | Monday (02:00), script | :x: | :x: | promotion | :x: | :x: |
| native_beta_delivery | script | :heavy_check_mark: | beta | :x: | :heavy_check_mark: | :x: |
| native_production_delivery | script | :heavy_check_mark: | production | :x: | :heavy_check_mark: | :x: |
| web_beta_delivery | script | :heavy_check_mark: | :x: | beta | :heavy_check_mark: | :x: |
| web_production_delivery | script | :heavy_check_mark: | :x: | production | :heavy_check_mark: | :x: |
| e2e_tests | commits on main | :x: | :x: | :x: | :x: | :x: |
| Workflow | Schedule/Trigger | Checks | native delivery | web delivery | Version bump | Move release notes |
| -------------------------- | ---------------- | ------------------ | --------------- | ------------ | ------------------ | ------------------ |
| commit | commits of PRs | :heavy_check_mark: | :x: | :x: | :x: | :x: |
| commit_main | commits on main | :x: | :x | webnext | :x: | :x: |
| delivery | script | :heavy_check_mark: | beta | beta | :heavy_check_mark: | :heavy_check_mark: |
| native_beta_delivery | script | :heavy_check_mark: | beta | :x: | :heavy_check_mark: | :x: |
| native_production_delivery | script | :heavy_check_mark: | production | :x: | :heavy_check_mark: | :x: |
| web_beta_delivery | script | :heavy_check_mark: | :x: | beta | :heavy_check_mark: | :x: |
| web_production_delivery | script | :heavy_check_mark: | :x: | production | :heavy_check_mark: | :x: |
| native_promotion | script | :x: | promotion | :x: | :x: | :x: |
| web_promotion | script | :x: | :x: | promotion | :x: | :x: |
| e2e_tests | script | :x: | :x: | :x: | :x: | :x: |
| native_browserstack | script | :x: | browserstack | :x: | :x: | :x: |

Steps executed if _Checks_ is checked :heavy_check_mark::

Expand All @@ -35,15 +36,14 @@ Steps executed if _Checks_ is checked :heavy_check_mark::
- TypeScript checks
- Unit testing with jest
- Building the app
- E2E tests

Steps executed if _Version bump_ is checked :heavy_check_mark::

- Bump version: Bump the version(s) and create a tag and release on github

## Failed Delivery

Sometimes it happens that one or multiple steps of our scheduled CI delivery workflow fails. In that case,
Sometimes it happens that one or multiple steps of our CI delivery workflow fails. In that case,
you should **not** use the `Restart Workflow from Start` (as this will lead to just another failure since the version number
was bumped before but not in the state of the failed delivery workflow such that it attempts to create the same releases again).

Expand All @@ -57,15 +57,15 @@ _native_beta_delivery_ or just run the whole _delivery_ workflow again. If that

## Triggering a Delivery

Normally the scheduled deliveries (see [workflows](#workflows)) should be frequent enough for most purposes.

If you still have to deliver a new reason for example for an urgent bug fix or because of a failed CI delivery,
the easiest way to deliver a new build to production or beta is to trigger the corresponding CircleCI workflows
_native_beta_delivery_, _native_production_delivery_, _web_beta_delivery_ and _web_production_delivery_:
If you want to deliver a new version, the easiest way to deliver a new build to production or beta is to trigger the corresponding CircleCI workflows
_delivery_, _native_beta_delivery_, _native_production_delivery_, _web_beta_delivery_ and _web_production_delivery_:

- Get a CircleCI [Personal API Token](https://circleci.com/docs/2.0/managing-api-tokens/).
- Trigger a delivery using the tool [trigger-pipeline](../tools/trigger-pipeline.ts):
`cd tools && yarn trigger-pipeline trigger <workflow-type> --api-token <api-token>`

```shell
cd tools && yarn trigger-pipeline trigger <workflow-type> --api-token <api-token> [--branch <branch>]
```

## Services

Expand Down Expand Up @@ -97,7 +97,7 @@ For delivery an [account without 2FA](https://github.com/fastlane/fastlane/blob/

#### Adding Testers to TestFlight

The [scheduled_native_production_workflow](#workflows) makes the builds directly available to TestFlights "App Store Connect Users". Those should not be confused with "External Tests" which require an approval by apple. Therefore, we currently only use "App Store Connect Users" as testers.
The _delivery_ and _native_beta_delivery_ [workflows](#workflows) make the builds directly available to TestFlights "App Store Connect Users". Those should not be confused with "External Tests" which require an approval by apple. Therefore, we currently only use "App Store Connect Users" as testers.

In order to add someone as "App Store Connect User" you have to add the Apple Account to App Store Connect and to TestFlight. This is a two-step process.

Expand Down
1 change: 1 addition & 0 deletions tools/trigger-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const WORKFLOW_TYPES = [
'web_promotion',
'delivery',
'e2e_tests',
'native_browserstack',
]

program
Expand Down
Loading