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

Fix CI builds #442

Merged
merged 12 commits into from
Feb 1, 2022
34 changes: 15 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ jobs:
build:
name: ${{ matrix.friendlyName }}
env:
DISPLAY: ":99.0"
CC: "clang"
CXX: "clang++"
npm_config_clang: "1"
# Needed until macos-11.0 hosted runners are available
SDKROOT: "/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk"

strategy:
matrix:
node-version: [15.x]
os: [ubuntu-16.04, windows-latest, macos-latest]
os: [ubuntu-20.04, windows-latest, macos-latest]
include:
- os: ubuntu-16.04
- os: ubuntu-20.04
friendlyName: Ubuntu
- os: windows-latest
friendlyName: Windows
Expand All @@ -40,12 +37,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: |
sudo apt-get install xvfb \
gnome-keyring \
sudo apt-get install gnome-keyring \
libsecret-1-dev \
dbus-x11 \
python-gnomekeyring
if: ${{ matrix.os == 'ubuntu-16.04' }}
python3-dev
if: ${{ matrix.os == 'ubuntu-20.04' }}
name: Install additional dependencies

# This step can be removed as soon as official Windows arm64 builds are published:
Expand All @@ -64,28 +60,28 @@ jobs:
name: Build native module from source

- run: |
echo "Initialize dbus..."
export NO_AT_BRIDGE=1;
echo "Install keyring..."
pip3 install --upgrade pip
pip3 install keyring
echo "Prepare D-Bus session..."
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)
eval $(echo 'somecredstorepass' | gnome-keyring-daemon --unlock)
echo "Create a test key using script..."
python -c "import gnomekeyring;gnomekeyring.create_sync('login', '');"
python -c "import keyring;keyring.set_password('system', 'login', 'pwd');"
npm test
if: ${{ matrix.os == 'ubuntu-16.04' }}
if: ${{ matrix.os == 'ubuntu-20.04' }}
name: Run tests (Linux)

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

- run: npm run prebuild-napi-x64
name: Prebuild (x64)

- run: npm run prebuild-napi-arm64
name: Prebuild (arm64)
if: ${{ matrix.os != 'ubuntu-16.04' }}
if: ${{ matrix.os != 'ubuntu-20.04' }}

- run: npm run prebuild-napi-ia32
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -97,7 +93,7 @@ jobs:
docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-napi-ia32 && rm -rf build"
docker build -t node-keytar/arm64-cross-compile docker/arm64-cross-compile
docker run --rm -v ${PWD}:/project node-keytar/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-arm64"
if: ${{ matrix.os == 'ubuntu-16.04' }}
if: ${{ matrix.os == 'ubuntu-20.04' }}
name: Prebuild (Linux x86 + ARM64)

- run: |
Expand Down