-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rakechill/nodeclaim-e2e
- Loading branch information
Showing
8 changed files
with
156 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CommitStatusEnd | ||
description: 'Adds a commit status at the end of the test run based on success, failure, or cancelled' | ||
inputs: | ||
name: | ||
description: "Name of the check" | ||
required: true | ||
git_ref: | ||
description: "The git commit, tag, or branch to check out. Requires a corresponding Karpenter snapshot release" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v6 | ||
if: job.status == 'success' | ||
with: | ||
script: | | ||
github.rest.repos.createCommitStatus({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
context: "${{ inputs.name }}", | ||
sha: "${{ inputs.git_ref }}", | ||
state: "success", | ||
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
}); | ||
- uses: actions/github-script@v6 | ||
if: job.status == 'failure' || job.status == 'cancelled' | ||
with: | ||
script: | | ||
github.rest.repos.createCommitStatus({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
context: "${{ inputs.name }}", | ||
sha: "${{ inputs.git_ref }}", | ||
state: "failure", | ||
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CommitStatusStart | ||
description: 'Adds a commit status at the start of the test run to set the status to pending' | ||
inputs: | ||
name: | ||
description: "Name of the check" | ||
required: true | ||
git_ref: | ||
description: "The git commit, tag, or branch to check out" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v6 | ||
if: always() | ||
with: | ||
script: | | ||
github.rest.repos.createCommitStatus({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
context: "${{ inputs.name }}", | ||
sha: "${{ inputs.git_ref }}", | ||
state: "pending", | ||
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: DownloadArtifacts | ||
description: 'Downloads and unarchives artifacts for a workflow that runs on workflow_run so that it can use its data' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id, | ||
}); | ||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "artifacts" | ||
})[0]; | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
let fs = require('fs'); | ||
fs.writeFileSync(`/tmp/artifacts.zip`, Buffer.from(download.data)); | ||
- run: | | ||
mkdir -p /tmp/artifacts | ||
unzip /tmp/artifacts.zip -d /tmp/artifacts | ||
shell: bash | ||
- run: | | ||
echo "Downloaded artifacts:" | ||
ls -ablh /tmp/artifacts | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: ResolveArgs | ||
on: | ||
workflow_call: | ||
outputs: | ||
GIT_REF: | ||
value: ${{ jobs.resolve.outputs.GIT_REF }} | ||
jobs: | ||
resolve: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
GIT_REF: ${{ steps.resolve-step.outputs.GIT_REF }} | ||
steps: | ||
# Download the artifact and resolve the GIT_REF | ||
- uses: actions/checkout@v4 | ||
- if: github.event_name == 'workflow_run' | ||
uses: ./.github/actions/download-artifact | ||
- id: resolve-step | ||
run: | | ||
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then | ||
echo GIT_REF="$(tail -n 1 /tmp/artifacts/metadata.txt)" >> "$GITHUB_OUTPUT" | ||
else | ||
echo GIT_REF="" >> "$GITHUB_OUTPUT" | ||
fi |