From a80e78c04474626ff785acafc9547d88317d6694 Mon Sep 17 00:00:00 2001 From: JohnnyChen Date: Thu, 4 Nov 2021 11:30:30 +0800 Subject: [PATCH] upgrade unit test CI settings --- .github/workflows/UnitTest.yml | 56 ++++++++++++++++++++++++++++++++++ .github/workflows/docs.yml | 41 +++++++++++++++++++++++++ .travis.yml | 28 ----------------- 3 files changed, 97 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/UnitTest.yml create mode 100644 .github/workflows/docs.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/UnitTest.yml b/.github/workflows/UnitTest.yml new file mode 100644 index 0000000..09dc64e --- /dev/null +++ b/.github/workflows/UnitTest.yml @@ -0,0 +1,56 @@ +name: Unit test + +on: + create: + tags: + push: + branches: + - master + pull_request: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + julia-version: ['1.3', '1', 'nightly'] + os: [ubuntu-latest] + arch: [x64] + include: + - os: windows-latest + julia-version: '1' + arch: x64 + - os: macOS-latest + julia-version: '1' + arch: x64 + - os: ubuntu-latest + julia-version: '1' + arch: x86 + + steps: + - uses: actions/checkout@v2 + - name: "Set up Julia" + uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.julia-version }} + arch: ${{ matrix.arch }} + + - 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 + + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..b59bdbd --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,41 @@ +name: Documentation + +on: + pull_request: + push: + branches: + - 'master' + - 'release-' + tags: '*' + release: + types: [published] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - 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/.travis.yml b/.travis.yml deleted file mode 100644 index a7cacc3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: julia -os: - - linux - - osx -julia: - - 1.3 - - 1.4 - - 1.5 - - nightly -notifications: - email: false -git: - depth: 99999999 -matrix: - allow_failures: - - julia: nightly -script: - - julia --color=yes -e 'using Pkg; Pkg.build()' - - julia --check-bounds=yes --color=yes -e 'using Pkg; Pkg.test(coverage=true)' -jobs: - include: - - stage: "Documentation" - julia: 1.4 - os: linux - script: - - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - julia --project=docs/ docs/make.jl - after_success: skip