diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2265238..b67bc3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,37 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} + e2e-test: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout Source + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Setup Go + uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5 + with: + go-version: 1.24 + check-latest: true + + - name: Setup Node + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: 20 + check-latest: true + + - name: Setup PNPM + uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4 + with: + version: 10 + + - name: Build Binary + run: make + + - name: Run E2E Tests + run: chmod +x test/e2e.sh && ./test/e2e.sh + shell: bash + goreleaser-test: runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/test/e2e.sh b/test/e2e.sh new file mode 100644 index 0000000..21b93aa --- /dev/null +++ b/test/e2e.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +scriptDir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) + +if ! command -v pmg &> /dev/null; then + alias pmg="$scriptDir/../bin/pmg" +fi + +echo "Running e2e tests..." + +## All these should be successful +pmg npm install express --dry-run +pmg --dry-run npm install express +pmg --dry-run pnpm add express + +## All these should fail +pmg --dry-run npm install nyc-config@10.0.0 \ No newline at end of file