-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (71 loc) · 1.76 KB
/
test.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
63
64
65
66
67
68
69
70
71
72
73
74
75
name: 'Build and test'
on:
push:
branches:
- master
pull_request:
env:
PRODUCTION: true
ENV_KEY_PROJECT_NAME: dot-env
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
check-latest: true
- run: |
corepack enable
- name: Install dependencies
run: |
pnpm install
- name: Build and package action
run: |
pnpm run format-check && pnpm run build && pnpm run package
- name: Verify is there is no diff
run: |
if [[ -n $(git diff --exit-code) ]]
then
echo "Please run `pnpm run build && pnpm run package` to update dist folder"
exit
fi
test:
name: Test env file
needs: build
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
env:
ENV_KEY_DEBUG: true
ENV_KEY_USERNAME: root
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
check-latest: true
- run: |
corepack enable
- id: test-action
uses: ./
with:
input-prefix: 'ENV_KEY_'
file-path: 'tests/development.env'
output-prefix: 'OUTPUT_'
env:
IS_SERVER: false
ENV_KEY_USERNAME: admin
ENV_KEY_API_KEY: USER_API_KEY
ENV_KEY_SECRET_KEY: secret123
ENV_KEY_ENV_KEY_MULTIPLE: test
SOME_ENV_KEY: no_value
- name: Install pnpm dependencies
run: |
pnpm install
- name: Run test
run: |
pnpm run test