diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 639e4a2d..6a6c016c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ env: jobs: osx: name: Create artifacts on macOS-latest - runs-on: macOS-latest + runs-on: macos-10.15 steps: - name: Checkout the repository uses: actions/checkout@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d49ad40..a2369110 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,17 +25,15 @@ jobs: --slave /usr/bin/g++ g++ /usr/bin/g++-9 bazelisk build //alphasql/... bazelisk test --test_output=errors //alphasql/... - - name: Test installation - run: | - temp=$(mktemp -d) - wget -P $temp https://github.com/Matts966/alphasql/releases/latest/download/alphasql_linux_x86_64.tar.gz \ - && sudo tar -zxvf $temp/alphasql_linux_x86_64.tar.gz -C /usr/local/bin --strip=1 - alphadag ./samples/sample + + ./bazel-bin/alphasql/alphadag ./samples/sample + ./bazel-bin/alphasql/alphadag --output_path=dag.dot ./samples/sample + ./bazel-bin/alphasql/alphadag --external_required_tables_output_path=dag.dot ./samples/sample osx: name: Test the repository on Mac - runs-on: macOS-latest + runs-on: macos-10.15 steps: - name: Checkout the repository uses: actions/checkout@v2 @@ -49,11 +47,11 @@ jobs: restore-keys: ${{ env.cache-version }}-${{ runner.os }}-bazelisk-build- - name: Test the repository run: | - make test - - name: Test installation - shell: bash - run: | - temp=$(mktemp -d) - wget -P $temp https://github.com/Matts966/alphasql/releases/latest/download/alphasql_darwin_x86_64.tar.gz \ - && sudo tar -zxvf $temp/alphasql_darwin_x86_64.tar.gz -C /usr/local/bin --strip=1 + brew install graphviz + sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer + bazel shutdown + make + alphadag ./samples/sample + alphadag --output_path=dag.dot ./samples/sample + alphadag --external_required_tables_output_path=dag.dot ./samples/sample diff --git a/alphasql/alphadag.cc b/alphasql/alphadag.cc index fc328eed..05da6569 100644 --- a/alphasql/alphadag.cc +++ b/alphasql/alphadag.cc @@ -17,6 +17,7 @@ #include "absl/flags/flag.h" #include "alphasql/dag_lib.h" #include +#include #include std::regex DEFAULT_EXCLUDES(".*(.git/.*|.hg/.*|.svn/.*)"); @@ -248,8 +249,10 @@ int main(int argc, char *argv[]) { !std::filesystem::exists(output_path)) { std::filesystem::path parent = std::filesystem::path(output_path).parent_path(); - if (!std::filesystem::is_directory(parent)) { - std::filesystem::create_directories(parent); + if (!std::filesystem::is_directory(parent) && parent != "") { + // Ignore error code for empty directory + std::error_code ec; + std::filesystem::create_directories(parent, ec); } std::ofstream out(output_path); write_graphviz_dp(out, g, dp); @@ -275,7 +278,9 @@ int main(int argc, char *argv[]) { std::filesystem::path(external_required_tables_output_path) .parent_path(); if (!std::filesystem::is_directory(parent)) { - std::filesystem::create_directories(parent); + // Ignore error code for empty directory + std::error_code ec; + std::filesystem::create_directories(parent, ec); } std::ofstream out(external_required_tables_output_path); for (const auto &required_table : external_required_tables) {