|
| 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) |
0 commit comments