From 8ce00839ca429ffc51df42be44aefe96fede9dcd Mon Sep 17 00:00:00 2001 From: Anchal Gupta Date: Mon, 6 May 2024 18:55:16 -0700 Subject: [PATCH] Adding CI Test for PR by using Github Actions Triggered at: * For pushing changes to master or dev branches * For pull requests to master or dev branches Features: * Uses Julia 1.9.3 (we can change or increase number of versions to be tested and supported later) * Uses ubuntu-latest in x86 architecture * Uses DVC to pull sample files (login to cybele using guptaa account) * Runs test using julia's native test feature. * CodeCov needs to be setup for reporting code coverage of the tests. --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..df9cbb2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Test + +on: + push: + branches: ["master", "dev", "autotest"] + pull_request: + branches: ["master", "dev"] +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1.9.3] + julia-arch: [x86] + os: [ubuntu-latest] + steps: + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + - uses: actions/checkout@v4 + - uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: | + ${{ secrets.SOLPSTESTSAMPLES_SSH_KEY}} + ${{ secrets.DVC_SSH_KEY }} + - name: Configure ssh + run: | + echo "${{ secrets.DVC_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts + echo "${{ secrets.DVC_SSH_CONFIG }}" >> ~/.ssh/config + - uses: iterative/setup-dvc@v1 + - name: DVC Pull + run: | + dvc pull + - uses: julia-actions/cache@v1 + - name: Install dependencies + run: | + julia --project=. -e 'using Pkg; Pkg.rm(["IMASDD"]); Pkg.add(url="git@github.com:ProjectTorreyPines/IMASDD.jl.git", rev="master")' + - uses: julia-actions/julia-runtest@v1 + # Not set up yet + # - uses: julia-actions/julia-processcoverage@v1 + # - uses: codecov/codecov-action@v4 + # with: + # files: lcov.info \ No newline at end of file diff --git a/README.md b/README.md index 41ca77c..0f3b390 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![Format Check](https://github.com/ProjectTorreyPines/GGDUtils.jl/actions/workflows/format_check.yml/badge.svg) ![Docs](https://github.com/ProjectTorreyPines/GGDUtils.jl/actions/workflows/make_docs.yml/badge.svg) +![Tests](https://github.com/ProjectTorreyPines/GGDUtils.jl/actions/workflows/test.yml/badge.svg) Package holding utilities for Generalized Grid Description (GGD) objects in IMAS datastructure. Primary goals are interpolation and core profile extrapolation. For installation and usage instructions, see the [online documentation](https://projecttorreypines.github.io/GGDUtils.jl/dev)