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.
    CodeCov needs to be setup for reporting code coverage of the tests.
  • Loading branch information
anchal-physics committed May 7, 2024
1 parent da8c33f commit a83a6a3
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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: Extract branch name
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install dependencies
run: |
julia --project=. -e 'using Pkg; Pkg.rm(["IMASDD", "GGDUtils"]); Pkg.add(url="git@github.com:ProjectTorreyPines/IMASDD.jl.git", rev="master"); Pkg.add(url="git@github.com:ProjectTorreyPines/GGDUtils.jl.git", rev="${{ steps.extract_branch.outputs.branch }}")'
- 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

0 comments on commit a83a6a3

Please sign in to comment.