Skip to content

Commit

Permalink
added ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zargham-ahmad committed Dec 12, 2023
1 parent 8afc318 commit 40b7deb
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This is a basic workflow to help you get started with Actions
name: R Conda (with codecov)

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master]
pull_request:
branches: [ master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Create conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mfassignr-dev
auto-update-conda: true
environment-file: conda/environment-dev.yaml
auto-activate-base: false
- run: |
conda init bash
conda env list
- name: Test coverage
run: |
conda activate mfassignr-dev
cd MFAssignR/
Rscript -e "covr::codecov(quiet = FALSE)"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion MFAssignR/tests/testthat/test-IsoFiltR.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
test_that("Isotope filtering works", {
load("../../data/Raw_Neg_ML.rda")
load(system.file("data", "Raw_Neg_ML.rda",
package = "MFAssignR",
mustWork = TRUE
))
expected <- readRDS("test-data/isotopes.rda")

actual <- IsoFiltR(Raw_Neg_ML)
Expand Down
5 changes: 4 additions & 1 deletion MFAssignR/tests/testthat/test-KMDNoise.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
test_that("KMDNoise works", {
load("../../data/Raw_Neg_ML.rda")
load(system.file("data", "Raw_Neg_ML.rda",
package = "MFAssignR",
mustWork = TRUE
))
names(Raw_Neg_ML) <- c("mass", "intensity")
actual <- KMDNoise(Raw_Neg_ML)
expect_equal(actual$Noise, 346.0706, tolerance = 1e-4)
Expand Down
1 change: 1 addition & 0 deletions environment.yaml → conda/environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ dependencies:
- r-devtools
- r-languageserver
- radian
- r-covr

0 comments on commit 40b7deb

Please sign in to comment.