Skip to content

Commit

Permalink
Adding CI testing
Browse files Browse the repository at this point in the history
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.
* Uploads generated images in test results to the artifacts.
* CodeCov needs to be setup for reporting code coverage of the tests.
  • Loading branch information
anchal-physics committed May 9, 2024
1 parent 73349e8 commit 828a0ee
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 6 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test

on:
push:
branches: ["master", "dev", "autotest"]
paths:
- '.github/workflows/test.yml'
- 'src/'
- 'test/'
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/[email protected]
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: Extract branch name
shell: bash
run: echo "branch=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install dependencies
run: |
julia --project=. -e 'using Pkg; Pkg.rm(["IMASDD", "GGDUtils", "SOLPS2IMAS", "EFIT"]); Pkg.add(; url="https://github.com/ProjectTorreyPines/IMASDD.jl.git"); Pkg.add(; url="https://github.com/ProjectTorreyPines/GGDUtils.jl.git", rev="${{ steps.extract_branch.outputs.branch }}"); Pkg.add(; url="https://github.com/ProjectTorreyPines/SOLPS2IMAS.jl.git", rev="${{ steps.extract_branch.outputs.branch }}"); Pkg.add(; url="https://github.com/JuliaFusion/EFIT.jl.git")'
- 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
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PolygonOps = "647866c9-e3ac-4575-94e7-e3d426903924"
SOLPS2IMAS = "09becab6-0636-4c23-a92a-2b3723265c31"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# SD4SOLPS

![Format Check](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/actions/workflows/format_check.yml/badge.svg)
![Docs](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/actions/workflows/make_docs.yml/badge.svg)
![Tests](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/actions/workflows/test.yml/badge.svg)

Synthetic diagnostic workflow manager for use with SOLPS models

This repository is the top level layer for managing a workflow for calculating
Expand All @@ -10,8 +15,13 @@ Steps:
3) Make assumptions to extend profiles into the core and far SOL, if needed
4) Run synthetic diagnostic models and record output

For installation and usage instructions, see the [online documentation](https://projecttorreypines.github.io/SynthDiag.jl/stable). For documentation on under development branch, see [dev online documentation](https://projecttorreypines.github.io/SynthDiag.jl/dev).

## Examples

## Building julia environment for SD4SOLPS
Refer to the instructions on this [wiki page](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/wiki/Demo) to see how to run `examples/demo.ipynb`.

## Building julia environment for SD4SOLPS for development

### Cloning using ssh

Expand Down Expand Up @@ -83,10 +93,6 @@ make Clean: Deletes Project.toml, Manifest.toml, and any cloned repositories for

Further options are same as above except for the difference that in case of cloning local copies of repos, they will be kept on same level as where you cloned SD4SOLPS.jl repo.

### Manual Install
### Manual Install for development

Refer to the instructions on this [wiki page](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/wiki).

## Use

Refer to the instructions on this [wiki page](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/wiki/Demo).

0 comments on commit 828a0ee

Please sign in to comment.