From 7f13f57e066af12412a778d5152af7493a442d74 Mon Sep 17 00:00:00 2001 From: Yuning Date: Fri, 19 Apr 2024 17:12:52 +0200 Subject: [PATCH] add continuous integration and test --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++ .github/workflows/documentation.yml | 6 +++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e41a1cb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: ['1.8', '1.10', 'nightly'] + os: [ubuntu-latest, windows-latest, macOS-latest] + include: + - julia-version: '1.10' + os: ubuntu-latest + coverage: true + exclude: + - julia-version: 'nightly' + os: windows-latest + - julia-version: 'nightly' + os: macOS-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.julia-version }} + - name: Install dependencies + run: julia --project -e 'using Pkg; Pkg.instantiate()' + - name: Run tests + run: julia --project -e 'using Pkg; Pkg.test()' + - name: Upload coverage + if: matrix.coverage + uses: julia-actions/julia-uploadcodecov@v1 \ No newline at end of file diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a450ded..cdf181a 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: - version: '1.6' + version: '1.10' - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy @@ -31,4 +31,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v3 \ No newline at end of file + - uses: codecov/codecov-action@v3 + +