-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (51 loc) · 1.63 KB
/
test_pnpm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Test Dependencies Setup
on:
workflow_dispatch:
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
setup_dependencies:
name: 'Setup and Test Dependencies'
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9.1.2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Setup PNPM Store Config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: Install Dependencies
run: |
if [ ! -f pnpm-lock.yaml ]; then
echo "Lockfile not found. Generating new lockfile."
pnpm install
else
echo "Lockfile found. Installing dependencies with frozen lockfile."
pnpm install --frozen-lockfile
fi
- name: Setup npmrc File for Private Registry
run: |
echo "@mycompany:registry=https://npm.pkg.github.com" >> "$HOME/.npmrc"
echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_PUBLISH_TOKEN }}" >> "$HOME/.npmrc"
echo "//registry.npmjs.org/:_authToken=null" >> "$HOME/.npmrc"
- name: Debugging Step
run: |
echo "Current Directory:"
pwd
echo "PNPM Cache Directory:"
ls -al $PNPM_CACHE_FOLDER
echo "NPMRC File:"
cat "$HOME/.npmrc"
- name: Test Dependencies
run: pnpm test # Replace with your actual test command if needed