From 9bab634f92f09b86aa1ef92580cb1eeaff376319 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Sat, 4 Jul 2020 18:51:35 +0800 Subject: [PATCH 1/3] switch UnitTest to github action Changes: * remove appveyor (and also windows 32bit) * leave travis for Documentation and Coverage * caching artifacts dir in CI --- .github/workflows/UnitTest.yml | 45 ++++++++++++++++++++++++++++++++++ .travis.yml | 29 +++++++++++----------- README.md | 12 +++------ appveyor.yml | 37 ---------------------------- 4 files changed, 63 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/UnitTest.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/UnitTest.yml b/.github/workflows/UnitTest.yml new file mode 100644 index 00000000..ba079b00 --- /dev/null +++ b/.github/workflows/UnitTest.yml @@ -0,0 +1,45 @@ +name: Unit test + +on: + create: + tags: + push: + branches: + - master + pull_request: + schedule: + - cron: '20 00 1 * *' + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: ['1.0', '1', 'nightly'] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v1.0.0 + - name: "Set up Julia" + uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.julia-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 }}- + + - name: "Unit Test" + uses: julia-actions/julia-runtest@master + + # Unless tokenless upload is enabled, we can only submit coverage via + # environment variable. But PRs from other fork can't do that. + # See issue: https://github.com/julia-actions/julia-uploadcodecov/issues/1 diff --git a/.travis.yml b/.travis.yml index 737527ab..43c98c11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,20 @@ +# Until https://github.com/julia-actions/julia-uploadcodecov/issues/1 get fixed +# submit coverage report via travis language: julia -os: - - osx - - linux -julia: - - 1.0 - - 1 - - nightly +julia: 1.0 +os: linux notifications: email: false +cache: + directories: + - $HOME/.julia/artifacts jobs: include: - - stage: "Documentation" - julia: 1.0 - os: linux + - stage: Coverage + codecov: true + + - stage: Documentation script: - - julia --project=docs -e 'using Pkg; Pkg.instantiate(); Pkg.add(PackageSpec(path=pwd()))' - - julia --project=docs docs/make.jl - after_success: skip -after_success: - - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())' + - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); + Pkg.instantiate()' + - julia --project=docs/ docs/make.jl diff --git a/README.md b/README.md index 464d34e3..a4d066dc 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,8 @@ | **Documentation** | **Build Status** | **Code Coverage** | |:---------------------------------------:|:-----------------------------------------:|:-------------------------------:| -| [![][docs-stable-img]][docs-stable-url] | [![Build Status][travis-img]][travis-url] | [![][codecov-img]][codecov-url] | -| [![][docs-dev-img]][docs-dev-url] | [![Build Status][appvey-img]][appvey-url] | | -| | [![PkgEval][pkgeval-img]][pkgeval-url] | | +| [![][docs-stable-img]][docs-stable-url] | [![Build Status][action-img]][action-url] | [![][codecov-img]][codecov-url] | +| [![][docs-dev-img]][docs-dev-url] | [![PkgEval][pkgeval-img]][pkgeval-url] | | This library provides a wide array of functions for dealing with color. This includes conversion between colorspaces, measuring distance between colors, @@ -16,11 +15,8 @@ simulating color blindness, parsing colors, and generating color scales for grap [docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg [docs-stable-url]: http://juliagraphics.github.io/Colors.jl/stable/ -[travis-img]: https://travis-ci.org/JuliaGraphics/Colors.jl.svg?branch=master -[travis-url]: https://travis-ci.org/JuliaGraphics/Colors.jl - -[appvey-img]: https://ci.appveyor.com/api/projects/status/trgtxvpfwrhm65w5?svg=true -[appvey-url]: https://ci.appveyor.com/project/cormullion/colors-jl/branch/master +[action-img]: https://github.com/JuliaGraphics/Colors.jl/workflows/Unit%20test/badge.svg +[action-url]: https://github.com/JuliaGraphics/Colors.jl/actions [pkgeval-img]: https://juliaci.github.io/NanosoldierReports/pkgeval_badges/C/Colors.svg [pkgeval-url]: https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 81bb802c..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,37 +0,0 @@ -environment: - matrix: - - julia_version: 1.0 - - julia_version: 1 - - julia_version: latest - -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: latest - -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%" From 83acaff5d8369078c9dce4a13efe31edc6821807 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 16 Jul 2020 13:07:32 +0800 Subject: [PATCH 2/3] move code coverage report and Documentation to Github Action --- .github/workflows/Documentations.yml | 40 ++++++++++++++++++++++++++++ .github/workflows/UnitTest.yml | 7 ++--- .travis.yml | 20 -------------- 3 files changed, 44 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/Documentations.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/Documentations.yml b/.github/workflows/Documentations.yml new file mode 100644 index 00000000..e4a259c0 --- /dev/null +++ b/.github/workflows/Documentations.yml @@ -0,0 +1,40 @@ +name: Documentation + +on: + pull_request: + push: + branches: + - 'master' + - 'release-' + tags: '*' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: ["1"] + julia-arch: [x86] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v1.0.0 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-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 }}- + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: julia --project=docs/ docs/make.jl diff --git a/.github/workflows/UnitTest.yml b/.github/workflows/UnitTest.yml index ba079b00..20130cb9 100644 --- a/.github/workflows/UnitTest.yml +++ b/.github/workflows/UnitTest.yml @@ -40,6 +40,7 @@ jobs: - name: "Unit Test" uses: julia-actions/julia-runtest@master - # Unless tokenless upload is enabled, we can only submit coverage via - # environment variable. But PRs from other fork can't do that. - # See issue: https://github.com/julia-actions/julia-uploadcodecov/issues/1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 43c98c11..00000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Until https://github.com/julia-actions/julia-uploadcodecov/issues/1 get fixed -# submit coverage report via travis -language: julia -julia: 1.0 -os: linux -notifications: - email: false -cache: - directories: - - $HOME/.julia/artifacts -jobs: - include: - - stage: Coverage - codecov: true - - - stage: Documentation - script: - - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); - Pkg.instantiate()' - - julia --project=docs/ docs/make.jl From 9182b1a6ea2ed03c8986952fa8eb83aea3b9b649 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 16 Jul 2020 15:01:14 +0800 Subject: [PATCH 3/3] pass julia-arch env to setup-julia stage --- .github/workflows/Documentations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Documentations.yml b/.github/workflows/Documentations.yml index e4a259c0..df76e532 100644 --- a/.github/workflows/Documentations.yml +++ b/.github/workflows/Documentations.yml @@ -14,13 +14,14 @@ jobs: strategy: matrix: julia-version: ["1"] - julia-arch: [x86] + julia-arch: [x64] os: [ubuntu-latest] steps: - uses: actions/checkout@v1.0.0 - uses: julia-actions/setup-julia@latest with: version: ${{ matrix.julia-version }} + arch: ${{ matrix.julia-arch }} - name: Cache artifacts uses: actions/cache@v1 env: