-
Notifications
You must be signed in to change notification settings - Fork 3
127 lines (107 loc) · 3.39 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
R-CMD-check:
runs-on: ubuntu-latest
container:
image: rocker/verse:latest
strategy:
matrix:
TEST_DATA: [
"inst/extdata/ExampleDb.tsv",
"test_repertoires/airr-covid-19.tsv",
"test_repertoires/PRJNA381394_12.tsv"
]
FORMAT: [
"html",
"pdf"
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::install(c("Biostrings", "GenomicAlignments", "IRanges"))
install.packages(c("airr", "alakazam", "ape", "ggpubr", "kableExtra", "optparse"))
shell: Rscript {0}
- name: Document
run: |
devtools::document()
shell: Rscript {0}
- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
options(crayon.enabled=TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--run-donttest"), error_on="warning", check_dir="check")
shell: Rscript {0}
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Install repcred
run: |
devtools::install(".")
shell: Rscript {0}
- name: Run tests matrix
run: |
inst/repcred.R -r ${{ matrix.TEST_DATA }} -o outdir -d TRUE -f ${{ matrix.FORMAT }}
- name: Create artifact name
run: |
test_name="${{ matrix.FORMAT }}_${{ matrix.TEST_DATA }}"
artifact_name=$(echo -n "$test_name" | sed -e 's/\//_/g' | sed -e 's/.tsv$//g' )
echo "ARTIFACT_NAME=$artifact_name" >> $GITHUB_ENV
- name: Archive results
uses: actions/upload-artifact@v3
with:
name: "repcred-report_${{ env.ARTIFACT_NAME }}"
path: |
outdir/results
build-container:
runs-on: ubuntu-latest
needs: R-CMD-check
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push to Docker
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/Dockerfile
push: true
no-cache: true
tags: airrc/rep-cred:latest
test-container:
runs-on: ubuntu-latest
needs: build-container
container:
image: airrc/rep-cred:latest
strategy:
matrix:
TEST_DATA: [
"test_repertoires/airr-covid-19.tsv"
]
FORMAT: [
"html",
"pdf"
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run repcred command
run: |
repcred -r ${{ matrix.TEST_DATA }} -o outdir -d TRUE -f ${{ matrix.FORMAT }}