Skip to content

Commit

Permalink
Use binary installations (#40)
Browse files Browse the repository at this point in the history
- add CRAN binaries env var from RSPM
- update actions versions
  • Loading branch information
LiNk-NY committed Nov 22, 2023
1 parent 0e6abc4 commit cf8bc64
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions .github/workflows/basic_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ jobs:
r-build-and-check:
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
R_REMOTES_NO_ERRORS_FROM_WARNINGS: TRUE
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest

steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v3

- name: Query dependencies and update old packages
run: |
Expand All @@ -23,7 +27,7 @@ jobs:

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: /usr/local/lib/R/site-library
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }}
Expand All @@ -49,9 +53,8 @@ jobs:
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check")
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}


- name: Build pkgdown
run: |
Expand All @@ -64,11 +67,12 @@ jobs:
apt-get -y install rsync
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v4
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
Expand All @@ -80,9 +84,9 @@ jobs:
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set Environment Variables
run: |
REPO_LOWER="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
Expand All @@ -91,30 +95,25 @@ jobs:
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@1e95c1de343b5b0c23352d6417ee3e48d5bcd422
with:
cosign-release: 'v1.4.0'
uses: sigstore/cosign-installer@v3


# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
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@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -124,19 +123,18 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
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@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:${{ env.GIT_SHA }}

0 comments on commit cf8bc64

Please sign in to comment.