Skip to content
Merged
Changes from all commits
Commits
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
32 changes: 26 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,39 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
ref: ${{ github.head_ref || github.ref }}
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}

- name: Download UPM package
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
with:
name: package-release
wait-timeout: 3600

- name: Verify package content against snapshot
# If this step fails, you can accept the new file content by
# running the following script locally with 'accept' as an argument
# and committing the new snapshot file to your branch. i.e:
# ./test/Scripts.Tests/test-pack-contents.ps1 accept
run: ./test/Scripts.Tests/test-pack-contents.ps1
- name: Check snapshot
id: snapshot-check
shell: pwsh
run: |
$ErrorActionPreference = 'Continue'
& ./test/Scripts.Tests/test-pack-contents.ps1
"result=$LASTEXITCODE" >> $env:GITHUB_OUTPUT

- name: Update snapshot for dependency bumps
if: steps.snapshot-check.outputs.result != '0' && github.event_name == 'pull_request' && startsWith(github.head_ref, 'deps/')
run: |
./test/Scripts.Tests/test-pack-contents.ps1 accept
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add test/Scripts.Tests/package-release.zip.snapshot
git commit -m "Update package release snapshot"
git push

- name: Fail on unexpected snapshot changes
if: steps.snapshot-check.outputs.result != '0' && !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'deps/'))
run: |
Write-Error "Package contents do not match snapshot. Run './test/Scripts.Tests/test-pack-contents.ps1 accept' locally and commit the update."
exit 1

# This produces the `samples/IntegrationTest` as `test-${{ matrix.unity-version }}`.
test-create:
Expand Down
Loading