![Title](https://maxulysse.github.io/assets/img/svg/cijoe.svg)
Maxime Garcia [
@gau](https://twitter.com/gau) [
@MaxUlysse](https://github.com/MaxUlysse) [
https://maxulysse.github.io/coffeencode2020](https://maxulysse.github.io/coffeencode2020) [
Coffee & Code: Continuous Integration](https://www.youtube.com/watch?v=gm_f_FeYHWA) Coffee n' Code Club - Science for Life Laboratory, Stockholm - 2020/05/28
---
===
--- For me, one fundamental part of Science is it's
REPRODUCIBILITY
=== And I think it is central when I'm developing === I want my code to run without issues on my machine
=== But also on other systems
And give out the same results
--- ## Tools
Versioning
Containers
Documentation
Tests
=== ## Different level of tests - `Unit tests` - `Integration tests` === ## Unit tests Check the functionality of a specific section of code === ## Integration tests Check the functionality of several sections of code as a group --- ## First advice DO TESTS
--- ## When to do tests
--- ## Where - [
Jenkins](https://www.jenkins.io/) - [
circleci](https://circleci.com/) - [
Travis CI](https://travis-ci.com/) - [
GitHub Actions](https://github.com/features/actions) --- ## Second advice Be lazy and automate
--- I do that on every project [maxulysse.github.io](https://github.com/MaxUlysse/maxulysse.github.io) ```yaml name: ci # This workflow is triggered on pushes and PRs to the repository. on: [push, pull_request] jobs: htmlproofer: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - uses: actions/setup-ruby@v1 with: ruby-version: 2.6.x - name: Install bundle run: bundle install --jobs=3 --retry=3 - name: Build website run: bundle exec jekyll build - name: Proof the html run: bundle exec htmlproofer ./_site --check-favicon --check-html --url-ignore /\#À/,/\#Ä/ --http-status-ignore=302,999 ``` --- ## For Sarek [![nf-core CI](https://github.com/nf-core/sarek/workflows/nf-core%20CI/badge.svg)](https://github.com/nf-core/sarek/actions/runs/115584315) [ci.yml](https://github.com/nf-core/sarek/blob/dev/.github/workflows/ci.yml) ```yml name: nf-core CI # This workflow is triggered on pushes and PRs to the repository. # It runs the pipeline with the minimal test dataset to check that it completes without any syntax errors. on: [push, pull_request] jobs: test: env: NXF_VER: ${{ matrix.nxf_ver }} NXF_ANSI_LOG: false runs-on: ubuntu-latest strategy: matrix: # Nextflow versions: check pipeline minimum and current latest nxf_ver: ['19.10.0', ''] steps: - uses: actions/checkout@v2 - name: Install Nextflow run: | wget -qO- get.nextflow.io | bash sudo mv nextflow /usr/local/bin/ - name: Pull docker image run: | docker pull nfcore/sarek:dev docker tag nfcore/sarek:dev nfcore/sarek:dev - name: Run test run: nextflow run ${GITHUB_WORKSPACE} -profile test,docker ``` === ## More tests ```yml tools: env: NXF_ANSI_LOG: false runs-on: ubuntu-latest strategy: matrix: tool: [Haplotypecaller, Freebayes, Manta, mpileup, MSIsensor, Strelka, TIDDIT] intervals: [--no_intervals, ''] exclude: - tool: Manta intervals: --no_intervals - tool: MSIsensor intervals: --no_intervals - tool: Strelka intervals: --no_intervals - tool: TIDDIT intervals: --no_intervals steps: - uses: actions/checkout@v2 - name: Install Nextflow run: | wget -qO- get.nextflow.io | bash sudo mv nextflow /usr/local/bin/ env: # Only check Nextflow pipeline minimum version NXF_VER: '19.10.0' - name: Pull docker image run: docker pull nfcore/sarek:dev - name: Run ${{ matrix.tool }} test run: nextflow run ${GITHUB_WORKSPACE} -profile test_tool,docker --tools ${{ matrix.tool }} ${{ matrix.intervals }} ``` === ## Plenty of tests Currently 6 different tests with multiple conditions 24 jobs in total
And more to come
--- [![Barncancerfonden](https://maxulysse.github.io/assets/img/svg/barncancerfonden_logo.svg)](https://www.barncancerfonden.se/en/) | [![KI](https://maxulysse.github.io/assets/img/svg/ki_logo.svg)](https://www.ki.se/) | [![Barntumörbanken](https://maxulysse.github.io/assets/img/svg/barntumorbanken_logo.svg)](https://ki.se/forskning/barntumorbanken) | [![SciLifeLab](https://maxulysse.github.io/assets/img/svg/scilifelab_logo.svg)](https://scilifelab.se/) | [![UPPMAX](https://maxulysse.github.io/assets/img/slides/uppmax.png)](https://uppmax.uu.se/) :-:|:-:|:-:|:-:|:-: ## Acknowledgments [![NGI](https://maxulysse.github.io/assets/img/svg/ngi_logo.svg "NGI")](https://ngisweden.scilifelab.se/) | [![NBIS](https://maxulysse.github.io/assets/img/svg/nbis_logo.svg "NBIS")](https://www.nbis.se/) | [![nf-core](https://maxulysse.github.io/assets/img/svg/nf-core_logo.svg)](https://nf-co.re/) | [![Nextflow](https://maxulysse.github.io/assets/img/slides/nextflow.png "Nextflow")](https://www.nextflow.io/) :-:|:-:|:-:|:-: ---
## Any questions - [
nf-co.re](https://nf-co.re/) - [
nf-co.re/sarek](https://nf-co.re/sarek) - [
#sarek](https://nfcore.slack.com/channels/sarek) - [
nf-co.re/rnafusion](https://nf-co.re/rnafusion) - [
#rnafusion](https://nfcore.slack.com/channels/rnafusion)