Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 7982613

Browse files
committed
add Actions workflow file for building project for CI
1 parent 321ea32 commit 7982613

File tree

4 files changed

+108
-5
lines changed

4 files changed

+108
-5
lines changed

.github/workflows/ci.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
# run when tag received matching version format
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
name: ${{ matrix.friendlyName }}
13+
env:
14+
DISPLAY: ":99.0"
15+
CC: "clang"
16+
CXX: "clang++"
17+
npm_config_clang: "1"
18+
19+
strategy:
20+
matrix:
21+
node-version: [15.x]
22+
os: [ubuntu-16.04, windows-latest, macos-latest]
23+
include:
24+
- os: ubuntu-16.04
25+
friendlyName: Ubuntu
26+
- os: windows-latest
27+
friendlyName: Windows
28+
- os: macos-latest
29+
friendlyName: macOS
30+
31+
runs-on: ${{ matrix.os }}
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Use Node.js ${{ matrix.node-version }}
36+
uses: actions/setup-node@v1
37+
with:
38+
node-version: ${{ matrix.node-version }}
39+
- run: |
40+
sudo apt-get install xvfb \
41+
gnome-keyring \
42+
libsecret-1-dev \
43+
dbus-x11 \
44+
python-gnomekeyring
45+
if: ${{ matrix.os == 'ubuntu-16.04' }}
46+
name: Install additional dependencies
47+
48+
- run: npm install
49+
name: Setup environment
50+
51+
- run: |
52+
echo "Initialize dbus..."
53+
export NO_AT_BRIDGE=1;
54+
eval $(dbus-launch --sh-syntax);
55+
echo "Unlocking the keyring..."
56+
eval $(echo -n "" | /usr/bin/gnome-keyring-daemon --login)
57+
eval $(/usr/bin/gnome-keyring-daemon --components=secrets --start)
58+
echo "Create a test key using script..."
59+
python -c "import gnomekeyring;gnomekeyring.create_sync('login', '');"
60+
npm test
61+
if: ${{ matrix.os == 'ubuntu-16.04' }}
62+
name: Run tests (Linux)
63+
64+
- run: npm test
65+
if: ${{ matrix.os != 'ubuntu-16.04' }}
66+
name: Run tests (Windows/macOS)
67+
68+
- run: |
69+
npm run prebuild-node
70+
npm run prebuild-electron
71+
name: Prebuild (x64)
72+
73+
- run: npm run prebuild-electron-arm64
74+
if: ${{ matrix.os != 'macos-latest' }}
75+
name: Prebuild for Electron (ARM64)
76+
77+
- run: |
78+
docker build -t node-keytar/i386 docker/i386
79+
docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-node-ia32 && npm run prebuild-electron-ia32"
80+
if: ${{ matrix.os == 'ubuntu-16.04' }}
81+
name: Prebuild (x86)
82+
83+
- run: |
84+
npm run prebuild-node-ia32
85+
npm run prebuild-electron-ia32
86+
if: ${{ matrix.os == 'windows-latest' }}
87+
name: Prebuild (x86)
88+
89+
- run: |
90+
ls prebuilds/
91+
name: List prebuilds
92+
93+
# only if tag found for release
94+
#- if defined APPVEYOR_REPO_TAG_NAME (npm run upload)

.github/workflows/codeql.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
name: "Code Scanning - Action"
1+
name: "Code Scanning"
22

33
on:
44
push:
55
schedule:
66
- cron: '0 0 * * 0'
77

88
jobs:
9-
CodeQL-Build:
9+
CodeQL:
10+
11+
name: ${{ matrix.friendlyName }}
1012

11-
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
1213
runs-on: ${{ matrix.os }}
1314
strategy:
1415
fail-fast: false
1516
matrix:
1617
os: [ubuntu-latest, windows-latest, macos-latest]
17-
18+
include:
19+
- os: ubuntu-latest
20+
friendlyName: Ubuntu
21+
- os: windows-latest
22+
friendlyName: Windows
23+
- os: macos-latest
24+
friendlyName: macOS
1825
steps:
1926
- name: Checkout repository
2027
uses: actions/checkout@v2

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"install": "prebuild-install || node-gyp rebuild",
3434
"lint": "npm run cpplint",
3535
"cpplint": "node-cpplint --filters legal-copyright,build-include,build-namespaces src/*.cc",
36-
"test": "npm run lint && npm build . && mocha --require babel-core/register spec/",
36+
"test": "npm run lint && npm rebuild && mocha --require babel-core/register spec/",
3737
"prebuild-node": "prebuild -t 8.9.0 -t 9.4.0 -t 10.11.0 -t 11.9.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 --strip",
3838
"prebuild-node-ia32": "prebuild -t 8.9.0 -t 9.4.0 -a ia32 --strip",
3939
"prebuild-electron": "prebuild -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -r electron --strip",

spec/keytar-spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ describe("keytar", function() {
131131
})
132132

133133
describe("findPassword(service)", function() {
134+
this.timeout(5000);
135+
134136
it("yields a password for the service", async function() {
135137
await keytar.setPassword(service, account, password),
136138
await keytar.setPassword(service, account2, password2)

0 commit comments

Comments
 (0)