diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4910257 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: ci + +on: + push: + pull_request: + +defaults: + run: + shell: bash + +jobs: + CI: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + env: + GKS_ENCODING: "utf8" + GKSwstype: "100" + + name: Julia ${{ matrix.version }} - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.version == 'nightly' }} + strategy: + fail-fast: false + matrix: + version: + - '1.3' + - '1' + - 'nightly' + os: + - ubuntu-latest + - windows-latest + - macos-latest + arch: + - x64 + # - x86 + + steps: + + # Setup environment + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.version }} + - name: Cache artifacts + uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + + # TESTCMD + - name: Default TESTCMD + run: echo ::set-env name=TESTCMD::"julia" + - name: Ubuntu TESTCMD + if: startsWith(matrix.os,'ubuntu') + run: echo ::set-env name=TESTCMD::"xvfb-run julia" + + # Julia Dependencies + - name: Install Julia dependencies + uses: julia-actions/julia-buildpkg@latest + + # Run tests + - name: Run Graphical test + run: $TESTCMD --project -e 'using Pkg; Pkg.test(coverage=true);' + + # - name: Codecov + # uses: julia-actions/julia-uploadcodecov@latest + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + Skip: + if: "contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ubuntu-latest + steps: + - name: Skip CI 🚫 + run: echo skip ci diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 325eb76..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: julia -os: - - linux - - osx -julia: - - 1.0 - - 1.3 - - nightly -notifications: - email: true -matrix: - allow_failures: - - julia: nightly - fast_finish: true diff --git a/Project.toml b/Project.toml index 0d1184f..06b327c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "VisualRegressionTests" uuid = "34922c18-7c2a-561c-bac1-01e79b2c4c92" author = "Thomas Breloff" -version = "0.3.3" +version = "1.0.0" [deps] ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" @@ -20,13 +20,14 @@ ImageFiltering = "0.4, 0.5, 0.6" ImageMagick = "0.7, 1" QuartzImageIO = "0.7" Requires = "1" -julia = "1" +julia = "1.3" [extras] +Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990" [targets] -test = ["Pkg", "Test", "Plots", "TestImages"] +test = ["Gtk", "Pkg", "Test", "Plots", "TestImages"] diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7930381..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,43 +0,0 @@ -environment: - matrix: - - julia_version: 1.0 - - julia_version: 1.3 - - julia_version: nightly - -platform: - - x86 # 32-bit - - x64 # 64-bit - -# # Uncomment the following lines to allow failures on nightly julia -# # (tests will run but not make your overall status red) -matrix: - allow_failures: - - julia_version: nightly - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" - -# # Uncomment to support code coverage upload. Should only be enabled for packages -# # which would have coverage gaps without running on Windows -# on_success: -# - echo "%JL_CODECOV_SCRIPT%" -# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" diff --git a/test/runtests.jl b/test/runtests.jl index 380de51..ff7f751 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,12 +1,7 @@ -using VisualRegressionTests -using Pkg, Test, Plots +using Gtk, Plots, Test, VisualRegressionTests # popup on local machine only -istravis = "TRAVIS" ∈ keys(ENV) -if !istravis - Pkg.add("Gtk") - using Gtk -end +istravis = get(ENV, "CI", "false") == "true" # load an image for testing import FileIO, TestImages