Skip to content
Merged
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
23 changes: 0 additions & 23 deletions .github/workflows/jest-detox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,6 @@ jobs:
working-directory: generic-reporter/jest/detox
script: npx detox test --configuration android.att.release --retries 1 --headless

# A pull_request run checks out a merge commit GitHub creates, so without
# this step Currents shows "Merge <sha> into <sha>" as the commit message.
# `currents upload` reads the COMMIT_INFO_* variables before git.
- name: Use the pull request commit for Currents
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
git fetch --depth=1 origin "$HEAD_SHA"
# A random delimiter: a commit message line equal to a fixed one would end the
# value early and add the lines after it as variables.
delimiter="EOF_$(openssl rand -hex 16)"
{
echo "COMMIT_INFO_SHA=$HEAD_SHA"
echo "COMMIT_INFO_BRANCH=$HEAD_REF"
echo "COMMIT_INFO_AUTHOR=$(git log -1 --format=%an "$HEAD_SHA")"
echo "COMMIT_INFO_EMAIL=$(git log -1 --format=%ae "$HEAD_SHA")"
echo "COMMIT_INFO_MESSAGE<<$delimiter"
git log -1 --format=%B "$HEAD_SHA"
echo "$delimiter"
} >> "$GITHUB_ENV"

# Runs after `detox test` exits, when Detox has finished writing the
# videos and logs.
- name: Upload the results to Currents
Expand Down
24 changes: 0 additions & 24 deletions generic-reporter/jest/detox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,3 @@ npx currents upload --project-id <project id> --key <record key>
## Run it in GitHub Actions

[`.github/workflows/jest-detox.yml`](../../../.github/workflows/jest-detox.yml) builds the app, starts an emulator with [`reactivecircus/android-emulator-runner`](https://github.com/ReactiveCircus/android-emulator-runner), runs the tests with `--retries 1` and uploads the results. Set the `CURRENTS_RECORD_KEY` secret and the `CURRENTS_PROJECT_ID` value to your own.

The workflow also sets the commit details of pull request runs. On `pull_request` events, GitHub checks out a merge commit that it creates, so without this step Currents shows the commit message as `Merge <sha> into <sha>`. The step reads the last commit of the pull request and passes it to `currents upload` through the `COMMIT_INFO_*` variables:

```yaml
- name: Use the pull request commit for Currents
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
git fetch --depth=1 origin "$HEAD_SHA"
# A random delimiter: a commit message line equal to a fixed one would end the
# value early and add the lines after it as variables.
delimiter="EOF_$(openssl rand -hex 16)"
{
echo "COMMIT_INFO_SHA=$HEAD_SHA"
echo "COMMIT_INFO_BRANCH=$HEAD_REF"
echo "COMMIT_INFO_AUTHOR=$(git log -1 --format=%an "$HEAD_SHA")"
echo "COMMIT_INFO_EMAIL=$(git log -1 --format=%ae "$HEAD_SHA")"
echo "COMMIT_INFO_MESSAGE<<$delimiter"
git log -1 --format=%B "$HEAD_SHA"
echo "$delimiter"
} >> "$GITHUB_ENV"
```
18 changes: 9 additions & 9 deletions generic-reporter/jest/detox/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generic-reporter/jest/detox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@currents/cmd": "1.11.0-beta.1",
"@currents/cmd": "1.11.0-beta.2",
"@currents/jest": "1.4.0-beta.1",
"@react-native-community/cli": "20.1.0",
"@react-native-community/cli-platform-android": "20.1.0",
Expand Down
Loading