Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI

on:
push:
branches: [ master ]
# run when tag received matching version format
pull_request:
branches: [ master ]

jobs:
build:
name: ${{ matrix.friendlyName }}
env:
DISPLAY: ":99.0"
CC: "clang"
CXX: "clang++"
npm_config_clang: "1"

strategy:
matrix:
node-version: [15.x]
os: [ubuntu-16.04, windows-latest, macos-latest]
include:
- os: ubuntu-16.04
friendlyName: Ubuntu
- os: windows-latest
friendlyName: Windows
- os: macos-latest
friendlyName: macOS

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: |
sudo apt-get install xvfb \
gnome-keyring \
libsecret-1-dev \
dbus-x11 \
python-gnomekeyring
if: ${{ matrix.os == 'ubuntu-16.04' }}
name: Install additional dependencies

- run: npm install
name: Setup environment

- run: |
echo "Initialize dbus..."
export NO_AT_BRIDGE=1;
eval $(dbus-launch --sh-syntax);
echo "Unlocking the keyring..."
eval $(echo -n "" | /usr/bin/gnome-keyring-daemon --login)
eval $(/usr/bin/gnome-keyring-daemon --components=secrets --start)
echo "Create a test key using script..."
python -c "import gnomekeyring;gnomekeyring.create_sync('login', '');"
npm test
if: ${{ matrix.os == 'ubuntu-16.04' }}
name: Run tests (Linux)

- run: npm test
if: ${{ matrix.os != 'ubuntu-16.04' }}
name: Run tests (Windows/macOS)

- run: |
npm run prebuild-node
npm run prebuild-electron
name: Prebuild (x64)

- run: npm run prebuild-electron-arm64
if: ${{ matrix.os != 'macos-latest' }}
name: Prebuild for Electron (ARM64)

- run: |
docker build -t node-keytar/i386 docker/i386
docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-node-ia32 && npm run prebuild-electron-ia32"
if: ${{ matrix.os == 'ubuntu-16.04' }}
name: Prebuild (x86)

- run: |
npm run prebuild-node-ia32
npm run prebuild-electron-ia32
if: ${{ matrix.os == 'windows-latest' }}
name: Prebuild (x86)

- run: |
ls prebuilds/
name: List prebuilds

# only if tag found for release
#- if defined APPVEYOR_REPO_TAG_NAME (npm run upload)
15 changes: 11 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
name: "Code Scanning - Action"
name: "Code Scanning"

on:
push:
schedule:
- cron: '0 0 * * 0'

jobs:
CodeQL-Build:
CodeQL:

name: ${{ matrix.friendlyName }}

# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

include:
- os: ubuntu-latest
friendlyName: Ubuntu
- os: windows-latest
friendlyName: Windows
- os: macos-latest
friendlyName: macOS
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dist: trusty
os:
- linux
- osx
node_js: 14
node_js: 15

env:
- CC=clang CXX=clang++ npm_config_clang=1
Expand Down Expand Up @@ -44,6 +44,9 @@ before_script:
"import gnomekeyring;gnomekeyring.create_sync('login', '');"
fi

install:
- npm install

script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then xvfb-run ./script/cibuild; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm test; fi
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ platform:
- x64

environment:
nodejs_version: "14"
nodejs_version: "15"

cache:
- node_modules
Expand All @@ -17,7 +17,7 @@ branches:
clone_depth: 10

install:
- ps: Install-Product node $env:nodejs_version x64
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:PLATFORM
- npm install

build_script:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"install": "prebuild-install || node-gyp rebuild",
"lint": "npm run cpplint",
"cpplint": "node-cpplint --filters legal-copyright,build-include,build-namespaces src/*.cc",
"test": "npm run lint && npm build . && mocha --require babel-core/register spec/",
"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",
"test": "npm run lint && npm rebuild && mocha --require babel-core/register spec/",
"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 -t 15.0.0 --strip",
"prebuild-node-ia32": "prebuild -t 8.9.0 -t 9.4.0 -a ia32 --strip",
"prebuild-electron": "prebuild -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -r electron --strip",
"prebuild-electron-arm64": "prebuild -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -r electron -a arm64 --strip",
Expand Down
2 changes: 2 additions & 0 deletions spec/keytar-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ describe("keytar", function() {
})

describe("findPassword(service)", function() {
this.timeout(5000);

it("yields a password for the service", async function() {
await keytar.setPassword(service, account, password),
await keytar.setPassword(service, account2, password2)
Expand Down