mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
test: Add E2E test
This commit is contained in:
@@ -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
|
||||
|
||||
+19
@@ -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
|
||||
Reference in New Issue
Block a user