-
Notifications
You must be signed in to change notification settings - Fork 14
125 lines (106 loc) · 3.75 KB
/
zowe-cli-plugin.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: zowe-cli-plugin
on: [push, pull_request, workflow_dispatch]
jobs:
test:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')
outputs:
npm-resolutions: ${{ steps.npm-update.outputs.result }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
os: [windows-latest, ubuntu-latest, macos-13]
env:
OS: ${{ matrix.os }}
NODE: ${{ matrix.node-version }}
NODE_OPTIONS: --max_old_space_size=4096
timeout-minutes: 60
concurrency:
group: ${{ matrix.os }}-node-${{ matrix.node-version }}-ci-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Downgrade Python
uses: actions/setup-python@v5
with:
python-version: '3.11.5'
- name: Install Node Package Dependencies
run: npm ci --quiet
- name: Update Dependencies
id: npm-update
uses: zowe-actions/octorelease/script@v1
with:
script: npmUpdate
- name: Windows only - Add clidriver to PATH
if: ${{ matrix.os == 'windows-latest' }}
run: echo "$((Get-Item .).FullName)/node_modules/ibm_db/installer/clidriver/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build Source
id: build
run: npm run build --if-present
- name: Unit Tests
id: unit
if: ${{ always() && steps.build.outcome == 'success' }}
run: npm run test:unit
- name: Archive Results
if: ${{ always() && steps.build.outcome == 'success' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.node-version }}-results
path: |
__tests__/__results__/
- name: Upload Results to Codecov
if: ${{ always() && steps.build.outcome == 'success' }}
uses: codecov/codecov-action@v4
with:
env_vars: OS,NODE
token: ${{ secrets.CODECOV_TOKEN }}
release:
if: github.event_name == 'push' && github.ref_protected
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.ref }}
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Downgrade Python
uses: actions/setup-python@v5
with:
python-version: '3.11.5'
- name: Install Dependencies
run: npm ci
- name: Update Dependencies
uses: zowe-actions/octorelease/script@v1
env:
GIT_COMMITTER_NAME: ${{ secrets.ZOWE_ROBOT_USER }}
GIT_COMMITTER_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }}
NPM_RESOLUTIONS: ${{ needs.test.outputs.npm-resolutions }}
with:
script: npmUpdate
- name: Build Source
run: npm run build
- uses: zowe-actions/octorelease@v1
env:
GIT_COMMITTER_NAME: ${{ secrets.ZOWE_ROBOT_USER }}
GIT_COMMITTER_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }}
GIT_CREDENTIALS: x-access-token:${{ secrets.ZOWE_ROBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
NPM_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
NPM_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }}