Skip to content

Commit

Permalink
Test update report
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 22, 2024
1 parent 8e6ffb1 commit e89ab65
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 10 deletions.
47 changes: 47 additions & 0 deletions .github/actions/vcpkg_update_report/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Compare vcpkg install changes
description: Compares vcpkg install outputs between the base and head refs on pull requests and generates a report.

inputs:
vcpkg-manifest-dir:
description: 'Directory containing the vcpkg.json manifest'
required: true
default: '.'
type: string
triplet:
description: 'Triplet to use for vcpkg installation'
required: true
default: 'x64-linux'
type: string

outputs:
report:
description: 'The report of added and removed packages after vcpkg installation comparison'

runs:
using: "composite"
steps:
# Run vcpkg install --dry-run on the head ref
- name: Run vcpkg install (HEAD)
shell: bash
run: |
vcpkg install --dry-run --triplet ${{ inputs.triplet }} --x-manifest-root=${{ inputs.vcpkg-manifest-dir }} > /tmp/vcpkg-head-output.txt
# Run vcpkg install --dry-run on the base ref
- name: Run vcpkg install (BASE)
shell: bash
run: |
git checkout ${{ github.event.pull_request.base.sha }}
vcpkg install --dry-run --triplet ${{ inputs.triplet }} --x-manifest-root=base-ref/${{ inputs.vcpkg-manifest-dir }} > /tmp/vcpkg-base-output.txt
# Compare the outputs and generate a report
- name: Compare vcpkg outputs
shell: bash
id: compare
run: |
diff /tmp/vcpkg-base-output.txt /tmp/vcpkg-head-output.txt
{
echo 'report<<EOF'
cat /tmp/vcpkg-report.diff
echo EOF
} >> "$GITHUB_OUTPUT"
1 change: 1 addition & 0 deletions .github/workflows/build_artifact_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflows:
- 🪟 MingW64 Windows 64bit Build
- 🪟 Windows Qt6
- 🧮 Vcpkg report
types:
- completed

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/vcpkg-update-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: 🧮 Vcpkg report
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
vcpkg-check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Generate diff report
id: vcpkg_diff
uses: ./.github/actions/vcpkg_update_report
with:
vcpkg-manifest-dir: vcpkg
triplet: x64-linux

- name: Schedule report comment
uses: ./.github/actions/post_sticky_comment
if: github.event_name == 'pull_request'
with:
marker: vcpkg-report
body: |
### 🧮 Vcpkg update report
```diff
${{ steps.vcpkg_diff.outputs.report }}
```
pr: ${{ github.event.number }}
11 changes: 1 addition & 10 deletions vcpkg/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"vcpkg-configuration": {
"default-registry": {
"kind": "git",
"reference": "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3",
"baseline": "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3",
"baseline": "9558037875497b9db8cf38fcd7db68ec661bffe7",
"repository": "https://github.com/microsoft/vcpkg"
},
"registries": [
Expand Down Expand Up @@ -94,14 +93,6 @@
]
},
"py-pip",
"py-pyqt6",
"py-qscintilla",
"py-numpy",
"py-requests",
"py-markupsafe",
"py-pyyaml",
"py-psycopg2",
"py-qgis-requirements",
"python3"
]
},
Expand Down

0 comments on commit e89ab65

Please sign in to comment.