diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5136814..2bde89c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,63 +1,63 @@ -name: Build Pymakr - -on: - pull_request: ~ - push: - branches-ignore: - - "dependabot/**" - paths-ignore: - - "doc/**" - schedule: - # Run everyday at 1am - - cron: "0 1 * * *" - -jobs: - build: - name: "Build ${{ matrix.os }}" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, macos-latest, ubuntu-latest] - steps: - - uses: actions/checkout@v1 - - - name: Setup node - uses: actions/setup-node@v1.2.0 - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' - with: - node-version: "10" - - - name: Fetch Electron Versions - id: electron - uses: ./.github/actions/fetch-electron-versions - with: - max-count: 3 - git-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Dependencies - shell: bash - run: | - npm install npx - npm add prebuild-install --save-dev - npm install --no-audit - - # todo: fix errors in running prebuild-install in Action runners - # - name: Update Native Modules - # run: npm run download-native - - # TODO - # - name: Test Bindings - - # generic all up electron test - - name: Test Bindings (macOS/Windows) - if: matrix.os != 'ubuntu-latest' - run: npm run test-electron -- ${{ steps.electron.outputs.versions }} - - # electron tests with virtual x server - - name: Test Bindings (Linux) - if: matrix.os == 'ubuntu-latest' - run: xvfb-run -e /dev/stdout -a npm run test-electron -- ${{ steps.electron.outputs.versions }} +# name: Build Pymakr + +# on: +# pull_request: ~ +# push: +# branches-ignore: +# - "dependabot/**" +# paths-ignore: +# - "doc/**" +# schedule: +# # Run everyday at 1am +# - cron: "0 1 * * *" + +# jobs: +# build: +# name: "Build ${{ matrix.os }}" +# runs-on: ${{ matrix.os }} +# strategy: +# matrix: +# os: [windows-latest, macos-latest, ubuntu-latest] +# steps: +# - uses: actions/checkout@v1 + +# - name: Setup node +# uses: actions/setup-node@v1.2.0 +# env: +# ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' +# with: +# node-version: "10" + +# - name: Fetch Electron Versions +# id: electron +# uses: ./.github/actions/fetch-electron-versions +# with: +# max-count: 3 +# git-token: ${{ secrets.GITHUB_TOKEN }} + +# - name: Install Dependencies +# shell: bash +# run: | +# npm install npx +# npm add prebuild-install --save-dev +# npm install --no-audit + +# # todo: fix errors in running prebuild-install in Action runners +# # - name: Update Native Modules +# # run: npm run download-native + +# # TODO +# # - name: Test Bindings + +# # generic all up electron test +# - name: Test Bindings (macOS/Windows) +# if: matrix.os != 'ubuntu-latest' +# run: npm run test-electron -- ${{ steps.electron.outputs.versions }} + +# # electron tests with virtual x server +# - name: Test Bindings (Linux) +# if: matrix.os == 'ubuntu-latest' +# run: xvfb-run -e /dev/stdout -a npm run test-electron -- ${{ steps.electron.outputs.versions }} # No tests written :( # - name: Run Tests diff --git a/lib/helpers/utils.js b/lib/helpers/utils.js index 574fdc2..bcbe974 100644 --- a/lib/helpers/utils.js +++ b/lib/helpers/utils.js @@ -83,11 +83,18 @@ export default class Utils { } ensureDirectoryExistence(dirname) { - if (fs.existsSync(dirname)) { - return true; + if (!fs.existsSync(dirname)) { + this.mkDirRecursive(dirname); } - fs.mkdirSync(dirname); - return false; + return true; + } + + mkDirRecursive(directory) { + if (!path.isAbsolute(directory)) return; + let parent = path.join(directory, '..'); + if (parent !== path.join('/') && !fs.existsSync(parent)) + this.mkDirRecursive(parent); + if (!fs.existsSync(directory)) fs.mkdirSync(directory); } setIgnoreFilter() {