Skip to content
Merged
Show file tree
Hide file tree
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
84 changes: 84 additions & 0 deletions .github/workflows/test-version-pin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: 'Test: Version Pinning'

on:
workflow_dispatch:
pull_request:
paths:
- 'src/installer.ts'
- '.github/workflows/test-version-pin.yml'

permissions:
contents: read

jobs:
test-pinned-version-ubuntu:
name: Pinned version (Ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Run apm-action with pinned version 0.7.5
uses: ./
with:
apm-version: '0.7.5'
dependencies: |
- microsoft/apm-sample-package

- name: Verify pinned version installed
run: |
VERSION=$(apm --version 2>&1)
echo "Installed APM version: $VERSION"
if echo "$VERSION" | grep -q "0.7.5"; then
echo "SUCCESS: Correct version 0.7.5 installed"
else
echo "FAIL: Expected version 0.7.5, got: $VERSION"
exit 1
fi

test-pinned-version-ubuntu-arm:
name: Pinned version (Ubuntu ARM64)
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6

- name: Run apm-action with pinned version 0.7.5
uses: ./
with:
apm-version: '0.7.5'
dependencies: |
- microsoft/apm-sample-package

- name: Verify pinned version installed
run: |
VERSION=$(apm --version 2>&1)
echo "Installed APM version: $VERSION"
if echo "$VERSION" | grep -q "0.7.5"; then
echo "SUCCESS: Correct version 0.7.5 installed on ARM64"
else
echo "FAIL: Expected version 0.7.5, got: $VERSION"
exit 1
fi

test-latest-version:
name: Latest version (Ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Run apm-action with latest
uses: ./
with:
apm-version: 'latest'
dependencies: |
- microsoft/apm-sample-package

- name: Verify latest version installed
run: |
VERSION=$(apm --version 2>&1)
echo "Installed APM version: $VERSION"
if [ -n "$VERSION" ]; then
echo "SUCCESS: APM latest installed — version: $VERSION"
else
echo "FAIL: APM not found or version empty"
exit 1
fi
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ inputs:
description: 'Produce .tar.gz instead of directory (used with pack: true)'
required: false
default: 'true'
github-token:
description: 'GitHub token for API calls (avoids rate limits). Defaults to the automatic GITHUB_TOKEN.'
required: false
default: '${{ github.token }}'

outputs:
success:
Expand Down
Loading