Skip to content

[ci] reduce duplication in scripts, clean up containers #136

[ci] reduce duplication in scripts, clean up containers

[ci] reduce duplication in scripts, clean up containers #136

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
# run by clicking buttons in the GitHub Actions UI
workflow_dispatch:
inputs:
deploy-docs:
description: 'Update the docs site?'
required: true
type: boolean
# automatically cancel in-progress builds if another commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# parallelize compilation (extra important for Linux, where CRAN doesn't supply pre-compiled binaries)
MAKEFLAGS: "-j4"
jobs:
build-docs:
uses: ./.github/workflows/build-docs.yaml
with:
deploy: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch' && inputs.deploy-docs == true) }}
secrets: inherit
lint:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pre-commit/[email protected]
- name: set up R
uses: r-lib/actions/setup-r@v2
- name: run lintr
run: |
Rscript -e "install.packages('lintr')"
Rscript ./.ci/lint-r-code.R $(pwd)
test:
name: test (ES ${{ matrix.es_version }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
es_version:
- 1.7.6
- 2.4.6
- 5.6.16
- 6.8.15
- 7.0.1
- 7.17.22
- 8.0.1
- 8.5.3
- 8.10.4
- 8.15.5
- 8.17.2
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: release
- name: set up pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: run tests
shell: bash
run: |
export ES_VERSION=${{ matrix.es_version }}
$GITHUB_WORKSPACE/.ci/setup.sh
$GITHUB_WORKSPACE/.ci/install.sh
$GITHUB_WORKSPACE/setup_local.sh ${{ matrix.es_version }}
$GITHUB_WORKSPACE/.ci/test.sh
$GITHUB_WORKSPACE/.ci/report_to_covr.sh
all-successful:
if: always()
runs-on: ubuntu-latest
needs:
- build-docs
- lint
- test
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}