Repository navigation
149 lines (132 loc) · 4.7 KB
/
Copy pathtests.yml
File metadata and controls
149 lines (132 loc) · 4.7 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
on:
push:
branches:
- jfirebaugh
tags:
- v*.*.*
pull_request:
name: Testing
permissions:
id-token: write
contents: read
jobs:
linux-tests:
name: "Linux Tests"
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
os: [ubuntu-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
container: ubuntu:20.04
steps:
- name: Install Dependencies for Ubuntu
run: apt-get update && apt-get install -y git build-essential clang libssl-dev libkrb5-dev libc++-dev wget python3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Setup Environment
run: |
mkdir ~/.ssh_tests
chmod 700 ~/.ssh_tests
printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config
node -e "require('fs').writeFileSync(require('os').homedir() + '/.ssh_tests/id_rsa', Buffer.from(require('fs').readFileSync('test/id_rsa.enc', 'utf8'), 'base64'))"
cp test/id_rsa.pub ~/.ssh_tests/id_rsa.pub
chmod 600 ~/.ssh_tests/id_rsa*
git config --global user.name "John Doe"
git config --global user.email [email protected]
- name: Install
env:
CC: clang
CXX: clang++
npm_config_clang: 1
GYP_DEFINES: use_obsolete_asm=true
# There is a race condition in node/generate that needs to be fixed
# Node 16 changed the logic it uses to select it's UID which means to make node run as root and not 1001, we need to chwon the current directory. More Details:
# https://stackoverflow.com/questions/70298238/getting-eaccess-when-running-npm-8-as-root
run: |
chown root.root -R .
npm set unsafe-perm true || true
node utils/retry npm install
- name: Test
run: |
set -e
eval `ssh-agent -s`
ssh-add ~/.ssh_tests/id_rsa
node utils/retry npm test
- name: configure aws credentials
if: startsWith(github.ref, 'refs/tags/v')
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::060562746757:role/nodegit-repository
aws-region: us-west-2
- name: Deploy
if: startsWith(github.ref, 'refs/tags/v')
run: |
npm install -g @mapbox/[email protected] aws-sdk
node lifecycleScripts/clean
node-pre-gyp package
node-pre-gyp publish
macos-tests:
name: "macOS Tests"
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
os: [macos-15, macos-15-intel]
runs-on: ${{ matrix.os }}
# 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: Use Node.js
uses: actions/setup-node@v4
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Setup Environment
run: |
mkdir ~/.ssh_tests
chmod 700 ~/.ssh_tests
printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config
node -e "require('fs').writeFileSync(require('os').homedir() + '/.ssh_tests/id_rsa', Buffer.from(require('fs').readFileSync('test/id_rsa.enc', 'utf8'), 'base64'))"
cp test/id_rsa.pub ~/.ssh_tests/id_rsa.pub
chmod 600 ~/.ssh_tests/id_rsa*
git config --global user.name "John Doe"
git config --global user.email [email protected]
- name: Install
env:
CC: clang
CXX: clang++
npm_config_clang: 1
GYP_DEFINES: use_obsolete_asm=true
# There is a race condition in node/generate that needs to be fixed
run: node utils/retry npm install
- name: Test
run: |
set -e
eval `ssh-agent -s`
ssh-add ~/.ssh_tests/id_rsa
node utils/retry npm test
- name: configure aws credentials
if: startsWith(github.ref, 'refs/tags/v')
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::060562746757:role/nodegit-repository
aws-region: us-west-2
- name: Deploy
if: startsWith(github.ref, 'refs/tags/v')
run: |
npm install -g @mapbox/[email protected] aws-sdk
node lifecycleScripts/clean
node-pre-gyp package
node-pre-gyp publish