-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
140 additions
and
24 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,68 @@ | ||
name: "PR Reports" | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
actions: read | ||
pull-requests: write | ||
|
||
jobs: | ||
report: | ||
name: "Report" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Find workflow run | ||
id: find-run | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: octokit/[email protected] | ||
with: | ||
route: GET /repos/${{ github.event.workflow_run.repository.full_name }}/actions/runs/${{ github.event.workflow_run.id }} | ||
|
||
- name: Extract PR number | ||
id: get-pr | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
head_branch=$(echo '${{ steps.find-run.outputs.data }}' | jq -r '.head_branch') | ||
head_repo=$(echo '${{ steps.find-run.outputs.data }}' | jq -r '.head_repository.full_name') | ||
if [[ "${head_branch}" != "" && "${head_repo}" != "" ]]; then | ||
pr_number="$(gh pr view -R "${head_repo}" "${head_branch}" --json number -q '.number')" | ||
else | ||
pr_number="" | ||
fi | ||
if [[ "${pr_number}" != "" ]]; then | ||
echo "This workflow run was for PR #${pr_number}." | ||
else | ||
echo "This workflow run was not for a PR." | ||
fi | ||
echo "pr_number=${pr_number}" >> "$GITHUB_OUTPUT" | ||
- name: Download code coverage reports | ||
if: steps.get-pr.outputs.pr_number != '' | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: codecov-reports | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
path: reports/ | ||
|
||
- name: Download performance reports | ||
if: steps.get-pr.outputs.pr_number != '' | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: perf-reports | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
path: reports/ | ||
|
||
- name: Show published reports | ||
if: steps.get-pr.outputs.pr_number != '' | ||
run: | | ||
ls -lR reports/ |
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 |
---|---|---|
|
@@ -5,12 +5,40 @@ on: | |
- main | ||
pull_request: | ||
paths: | ||
- '.devcontainer/**' | ||
- ".devcontainer/**" | ||
|
||
jobs: | ||
build: | ||
name: "Build and publish" | ||
name: "Build devcontainer" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Pre-build dev container image | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: ghcr.io/reubeno/brush/devcontainer | ||
imageTag: latest | ||
cacheFrom: ghcr.io/reubeno/brush/devcontainer | ||
push: never | ||
|
||
build_and_publish: | ||
name: "Build and publish devcontainer" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|