diff --git a/.github/workflows/jest-detox.yml b/.github/workflows/jest-detox.yml index 7c3aa7d..e330f03 100644 --- a/.github/workflows/jest-detox.yml +++ b/.github/workflows/jest-detox.yml @@ -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 into " 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 diff --git a/generic-reporter/jest/detox/README.md b/generic-reporter/jest/detox/README.md index 88c36d4..a5f728d 100644 --- a/generic-reporter/jest/detox/README.md +++ b/generic-reporter/jest/detox/README.md @@ -64,27 +64,3 @@ npx currents upload --project-id --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 into `. 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" -``` diff --git a/generic-reporter/jest/detox/package-lock.json b/generic-reporter/jest/detox/package-lock.json index d42f3e1..651d5d5 100644 --- a/generic-reporter/jest/detox/package-lock.json +++ b/generic-reporter/jest/detox/package-lock.json @@ -16,7 +16,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", @@ -2010,14 +2010,14 @@ } }, "node_modules/@currents/cmd": { - "version": "1.11.0-beta.1", - "resolved": "https://registry.npmjs.org/@currents/cmd/-/cmd-1.11.0-beta.1.tgz", - "integrity": "sha512-moy/oo2662if90Cxf4lsz7JnjfDMhuF1ec4eVM9szWJBPNXxf6DjL5tqRcB/wdtzRXOpXm27/j+2rxOLHhQjRw==", + "version": "1.11.0-beta.2", + "resolved": "https://registry.npmjs.org/@currents/cmd/-/cmd-1.11.0-beta.2.tgz", + "integrity": "sha512-7wmiNkNsqLtoiLdhZSHO0/0A2GRbh0B+KW+noA6q90CHPAlAANYdbAi8+mdG2QpEuc/E7+ExRvO/+HzaD4HvsA==", "dev": true, "license": "MIT", "dependencies": { "@commander-js/extra-typings": "^13.1.0", - "@currents/commit-info": "1.0.1-beta.0", + "@currents/commit-info": "1.1.0", "archiver": "^7.0.1", "async-retry": "^1.3.3", "axios": "1.18.1", @@ -2066,9 +2066,9 @@ } }, "node_modules/@currents/commit-info": { - "version": "1.0.1-beta.0", - "resolved": "https://registry.npmjs.org/@currents/commit-info/-/commit-info-1.0.1-beta.0.tgz", - "integrity": "sha512-gkn8E3UC+F4/fCla7QAGMGgGPzxZUL9bU9+4I+KZf9PtCU3DdQCdy7a+er2eg4ewfUzZ2Ic1HcfnHuPkuLPKIw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@currents/commit-info/-/commit-info-1.1.0.tgz", + "integrity": "sha512-WyYyCXWs2leU4zXZLqnlY/N7ELcpnISVP+94brKs/MBoXNlXN5RDW8TIM9C4UYmKAMAg0oNU9/tKRM9GKWTmbg==", "dev": true, "license": "MIT", "dependencies": { @@ -2080,7 +2080,7 @@ "ramda": "0.26.1" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@currents/commit-info/node_modules/cross-spawn": { diff --git a/generic-reporter/jest/detox/package.json b/generic-reporter/jest/detox/package.json index d1901da..2857f17 100644 --- a/generic-reporter/jest/detox/package.json +++ b/generic-reporter/jest/detox/package.json @@ -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",