generated from Bioconductor/BuildABiocWorkshop
-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (109 loc) · 4.14 KB
/
basic_checks.yaml
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
128
129
130
name: Check, build, and push image
on: [push, pull_request]
env:
cache-version: v1
jobs:
r-build-and-check:
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: TRUE
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Query dependencies and update old packages
run: |
BiocManager::install(ask=FALSE)
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v4
with:
path: /usr/local/lib/R/site-library
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-
- name: Install dependencies
run: |
BiocManager::repositories()
remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories())
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error", check_dir = "check")
shell: Rscript {0}
- name: Build pkgdown
run: |
PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site(".")'
# deploy needs rsync? Seems so.
- name: Install deploy dependencies
run: |
apt-get update
apt-get -y install rsync
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
docker-build-and-push:
#needs: r-build-and-check
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Environment Variables
run: |
REPO_LOWER="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
REGISTRY=ghcr.io
echo "BUILD_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
echo "GIT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV
echo "IMAGE=${REGISTRY}/${REPO_LOWER}" >> $GITHUB_ENV
- name: Show environment
run: |
env
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:${{ env.GIT_SHA }}