forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 1
178 lines (154 loc) · 5.61 KB
/
tests.yml
File metadata and controls
178 lines (154 loc) · 5.61 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
on:
pull_request:
workflow_dispatch:
name: Testing
jobs:
linux-tests:
name: "Linux Tests"
strategy:
matrix:
node: [22.18.0]
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Install Dependencies for Ubuntu
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common git build-essential clang libssl-dev libkrb5-dev libc++-dev wget zlib1g-dev
echo "npm_config_openssl_dir=/usr/lib/ssl" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- name: Setup Environment
run: |
set -e
mkdir ~/.ssh_tests
chmod 700 ~/.ssh_tests
printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config
cat test/id_rsa.pub > ~/.ssh_tests/id_rsa.pub
cat test/id_rsa.enc | base64 -d > ~/.ssh_tests/id_rsa
chmod 600 ~/.ssh_tests/id_rsa*
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Install
run: npm ci
- name: Test
run: |
set -e
eval `ssh-agent -s`
ssh-add ~/.ssh_tests/id_rsa
node utils/retry npm test
- name: Deploy
if: startsWith(github.ref, 'refs/tags/v')
env:
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
run: |
npm install -g @mapbox/node-pre-gyp aws-sdk
node lifecycleScripts/clean
node-pre-gyp package
node-pre-gyp publish
macos-tests:
name: "macOS Tests"
strategy:
matrix:
node: [22.18.0]
fail-fast: false
runs-on: macOS-13
# This is mostly the same as the Linux steps, waiting for anchor support
# https://github.com/actions/runner/issues/1182
steps:
- uses: actions/checkout@v4
- name: Setup Environment
run: |
echo "npm_config_openssl_dir=/usr/local/opt/openssl@1.1" >> "$GITHUB_ENV"
mkdir ~/.ssh_tests
chmod 700 ~/.ssh_tests
printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config
cat test/id_rsa.pub > ~/.ssh_tests/id_rsa.pub
cat test/id_rsa.enc | base64 -d > ~/.ssh_tests/id_rsa
chmod 600 ~/.ssh_tests/id_rsa*
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Install
run: npm ci
- name: Test
run: |
set -e
eval `ssh-agent -s`
ssh-add ~/.ssh_tests/id_rsa
node utils/retry npm test
- name: Deploy
if: startsWith(github.ref, 'refs/tags/v')
env:
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
run: |
npm install -g @mapbox/node-pre-gyp aws-sdk
node lifecycleScripts/clean
node-pre-gyp package
node-pre-gyp publish
windows-tests:
name: Windows Tests
strategy:
matrix:
node: [22.18.0]
arch: [x64]
fail-fast: false
runs-on: windows-2022
steps:
- name: Setup Environment
run: |
echo "npm_config_openssl_dir=C:\Program Files\OpenSSL-Win64" >> "$GITHUB_ENV"
git config --file C:\ProgramData\Git\config core.autocrlf input
git config --system core.autocrlf input
git config --global core.autocrlf input
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
architecture: ${{ matrix.arch }}
- name: Install
run: npm ci
- name: Test
env:
GIT_SSH: ${{ github.workspace }}\vendor\plink.exe
run: |
powershell -command "Start-Process ${{ github.workspace }}\vendor\pageant.exe ${{ github.workspace }}\vendor\private.ppk"
node utils/retry npm test
# You're probably wondering why this isn't a single `run: |` step, it certainly is for *nix,
# but it's not, because the CI runner for windows doesn't wait for each step as listed here
# and it treats each additional step past the first as an orphaned process.
- name: Deploy (Dependencies)
if: startsWith(github.ref, 'refs/tags/v')
run: npm install -g @mapbox/node-pre-gyp aws-sdk
- name: Deploy (Clean)
if: startsWith(github.ref, 'refs/tags/v')
run: node lifecycleScripts\clean
- name: Deploy (Package)
if: startsWith(github.ref, 'refs/tags/v')
run: node-pre-gyp package
- name: Deploy (Publish)
if: startsWith(github.ref, 'refs/tags/v')
env:
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
run: node-pre-gyp publish