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

ci: reuse uploaded baseline app for e2e perf. regression testing pipeline #36686

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
8 changes: 7 additions & 1 deletion .github/actions/composite/buildAndroidE2EAPK/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ inputs:
ARTIFACT_NAME:
description: The name of the workflow artifact where the APK should be uploaded
required: true
ARTIFACT_RETENTION_DAYS:
description: The number of days to retain the artifact
required: false
# Thats github default:
default: "90"
PACKAGE_SCRIPT_NAME:
description: The name of the npm script to run to build the APK
required: true
Expand Down Expand Up @@ -69,7 +74,8 @@ runs:
shell: bash

- name: Upload APK
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: ${{ inputs.ARTIFACT_NAME }}
path: ${{ inputs.APP_OUTPUT_PATH }}
retention-days: ${{ inputs.ARTIFACT_RETENTION_DAYS }}
8 changes: 8 additions & 0 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,14 @@ class GithubUtils {
.then((events) => _.filter(events, (event) => event.event === 'closed'))
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
}

static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
per_page: 100,
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
}
}

module.exports = GithubUtils;
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@ class GithubUtils {
.then((events) => _.filter(events, (event) => event.event === 'closed'))
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
}

static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
per_page: 100,
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
}
}

module.exports = GithubUtils;
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,14 @@ class GithubUtils {
.then((events) => _.filter(events, (event) => event.event === 'closed'))
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
}

static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
per_page: 100,
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
}
}

module.exports = GithubUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,14 @@ class GithubUtils {
.then((events) => _.filter(events, (event) => event.event === 'closed'))
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
}

static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
per_page: 100,
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
}
}

module.exports = GithubUtils;
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/javascript/getArtifactInfo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Get artifact info
description: Gets the ID and workflow ID about a specific artifact. By default artifacts are only available in the same workflow. This action can be used to get the information needed to download an artifact from a different workflow.

inputs:
hannojg marked this conversation as resolved.
Show resolved Hide resolved
GITHUB_TOKEN:
description: Auth token for New Expensify Github; necessary for accessing Octokit.
required: true
ARTIFACT_NAME:
description: Name of the artifact to get infos about (e.g. to use for downloading that artifact)
required: true

outputs:
hannojg marked this conversation as resolved.
Show resolved Hide resolved
ARTIFACT_FOUND:
description: Whether the artifact was found
ARTIFACT_ID:
description: The ID of the artifact
ARTIFACT_WORKFLOW_ID:
description: The ID of the workflow that produced the artifact

runs:
hannojg marked this conversation as resolved.
Show resolved Hide resolved
using: "node20"
main: "index.js"
31 changes: 31 additions & 0 deletions .github/actions/javascript/getArtifactInfo/getArtifactInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const _ = require('underscore');
const core = require('@actions/core');
const GithubUtils = require('../../../libs/GithubUtils');

const run = function () {
const artifactName = core.getInput('ARTIFACT_NAME', {required: true});

return GithubUtils.getArtifactByName(artifactName)
.then((artifact) => {
if (_.isUndefined(artifact)) {
console.log(`No artifact found with the name ${artifactName}`);
core.setOutput('ARTIFACT_FOUND', false);
return;
}

console.log('Artifact info', artifact);
core.setOutput('ARTIFACT_FOUND', true);
core.setOutput('ARTIFACT_ID', artifact.id);
core.setOutput('ARTIFACT_WORKFLOW_ID', artifact.workflow_run.id);
})
.catch((error) => {
console.error('A problem occurred while trying to communicate with the GitHub API', error);
core.setFailed(error);
});
};

if (require.main === module) {
run();
}

module.exports = run;
Loading
Loading