11on :
22 push :
33 branches :
4- - master
5- - backport/*
4+ - jfirebaugh
65 tags :
76 - v*.*.*
87 pull_request :
98
109name : Testing
1110
11+ permissions :
12+ id-token : write
13+ contents : read
14+
1215jobs :
1316 linux-tests :
1417 name : " Linux Tests"
1518 strategy :
19+ fail-fast : false
1620 matrix :
17- node : [16] # 18+ requires GLIBC 2.28+
21+ node : [18, 20]
1822 runs-on : ubuntu-latest
19- container : ubuntu:16 .04
23+ container : ubuntu:20 .04
2024 steps :
2125 - name : Install Dependencies for Ubuntu
22- # git >= 2.18 required for actions/checkout git support
23- run : apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:git-core/ppa && apt-get update && apt-get install -y git build-essential clang libssl-dev libkrb5-dev libc++-dev wget
26+ run : apt-get update && apt-get install -y git build-essential clang libssl-dev libkrb5-dev libc++-dev wget python3
2427 env :
2528 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
2629
27- - name : Setup python 3.6
28- env :
29- CC : clang
30- CXX : clang++
31- run : |
32- mkdir ~/python
33- cd ~/python
34- wget https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz
35- tar -xvf Python-3.6.15.tgz
36- cd Python-3.6.15
37- ./configure
38- make
39- make install
40-
4130 - name : Setup Environment
4231 run : |
4332 mkdir ~/.ssh_tests
@@ -49,12 +38,10 @@ jobs:
4938 git config --global user.name "John Doe"
5039 git config --global user.email johndoe@example.com
5140
52- # v4 requires node 20, which won't run due to GLIBC 2.28+ requirement
53- - uses : actions/checkout@v3
41+ - uses : actions/checkout@v4
5442
5543 - name : Use Node.js
56- # v4 requires node 20, which won't run due to GLIBC 2.28+ requirement
57- uses : actions/setup-node@v3
44+ uses : actions/setup-node@v4
5845 env :
5946 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
6047 with :
7259 # https://stackoverflow.com/questions/70298238/getting-eaccess-when-running-npm-8-as-root
7360 run : |
7461 chown root.root -R .
75- npm set unsafe-perm true
62+ npm set unsafe-perm true || true
7663 node utils/retry npm install
7764
7865 - name : Test
@@ -82,12 +69,15 @@ jobs:
8269 ssh-add ~/.ssh_tests/id_rsa
8370 node utils/retry npm test
8471
72+ - name : configure aws credentials
73+ if : startsWith(github.ref, 'refs/tags/v')
74+ uses : aws-actions/configure-aws-credentials@v1
75+ with :
76+ role-to-assume : arn:aws:iam::060562746757:role/nodegit-repository
77+ aws-region : us-west-2
78+
8579 - name : Deploy
8680 if : startsWith(github.ref, 'refs/tags/v')
87- env :
88- node_pre_gyp_bucket : ${{ secrets.node_pre_gyp_bucket }}
89- AWS_ACCESS_KEY_ID : ${{ secrets.node_pre_gyp_accessKeyId }}
90- AWS_SECRET_ACCESS_KEY : ${{ secrets.node_pre_gyp_secretAccessKey }}
9181 run : |
9282 npm install -g @mapbox/node-pre-gyp aws-sdk
9383 node lifecycleScripts/clean
9787 macos-tests :
9888 name : " macOS Tests"
9989 strategy :
90+ fail-fast : false
10091 matrix :
101- node : [16, 18, 20]
102- runs-on : macOS-12
92+ node : [18, 20]
93+ os : [macOS-12, macos-13-xlarge]
94+ runs-on : ${{ matrix.os }}
10395 # This is mostly the same as the Linux steps, waiting for anchor support
10496 # https://github.com/actions/runner/issues/1182
10597 steps :
@@ -140,74 +132,17 @@ jobs:
140132 ssh-add ~/.ssh_tests/id_rsa
141133 node utils/retry npm test
142134
135+ - name : configure aws credentials
136+ if : startsWith(github.ref, 'refs/tags/v')
137+ uses : aws-actions/configure-aws-credentials@v1
138+ with :
139+ role-to-assume : arn:aws:iam::060562746757:role/nodegit-repository
140+ aws-region : us-west-2
141+
143142 - name : Deploy
144143 if : startsWith(github.ref, 'refs/tags/v')
145- env :
146- node_pre_gyp_bucket : ${{ secrets.node_pre_gyp_bucket }}
147- AWS_ACCESS_KEY_ID : ${{ secrets.node_pre_gyp_accessKeyId }}
148- AWS_SECRET_ACCESS_KEY : ${{ secrets.node_pre_gyp_secretAccessKey }}
149144 run : |
150145 npm install -g @mapbox/node-pre-gyp aws-sdk
151146 node lifecycleScripts/clean
152147 node-pre-gyp package
153148 node-pre-gyp publish
154-
155- windows-tests :
156- name : Windows Tests
157- strategy :
158- matrix :
159- node : [16, 18, 20]
160- arch : [x86, x64]
161- runs-on : windows-2019
162- steps :
163- - name : Setup Environment
164- run : |
165- git config --file C:\ProgramData\Git\config core.autocrlf input
166- git config --system core.autocrlf input
167- git config --global core.autocrlf input
168- git config --global user.name "John Doe"
169- git config --global user.email johndoe@example.com
170-
171- - uses : actions/checkout@v4
172-
173- - name : Use Node.js
174- uses : actions/setup-node@v4
175- env :
176- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
177- with :
178- node-version : ${{ matrix.node }}
179- check-latest : true
180- architecture : ${{ matrix.arch }}
181-
182- - name : Install
183- run : npm install
184-
185- - name : Test
186- env :
187- GIT_SSH : ${{ github.workspace }}\vendor\plink.exe
188- run : |
189- powershell -command "Start-Process ${{ github.workspace }}\vendor\pageant.exe ${{ github.workspace }}\vendor\private.ppk"
190- node utils/retry npm test
191-
192- # You're probably wondering why this isn't a single `run: |` step, it certainly is for *nix,
193- # but it's not, because the CI runner for windows doesn't wait for each step as listed here
194- # and it treats each additional step past the first as an orphaned process.
195- - name : Deploy (Dependencies)
196- if : startsWith(github.ref, 'refs/tags/v')
197- run : npm install -g @mapbox/node-pre-gyp aws-sdk
198-
199- - name : Deploy (Clean)
200- if : startsWith(github.ref, 'refs/tags/v')
201- run : node lifecycleScripts\clean
202-
203- - name : Deploy (Package)
204- if : startsWith(github.ref, 'refs/tags/v')
205- run : node-pre-gyp package
206-
207- - name : Deploy (Publish)
208- if : startsWith(github.ref, 'refs/tags/v')
209- env :
210- node_pre_gyp_bucket : ${{ secrets.node_pre_gyp_bucket }}
211- AWS_ACCESS_KEY_ID : ${{ secrets.node_pre_gyp_accessKeyId }}
212- AWS_SECRET_ACCESS_KEY : ${{ secrets.node_pre_gyp_secretAccessKey }}
213- run : node-pre-gyp publish
0 commit comments