Skip to content

Commit

Permalink
Updated gradle, yml, rDNA tests+check
Browse files Browse the repository at this point in the history
  • Loading branch information
leifeld committed Aug 19, 2024
1 parent e926c38 commit 6f6639d
Show file tree
Hide file tree
Showing 38 changed files with 538 additions and 324 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,74 @@ name: build
on: [push, pull_request, workflow_dispatch]

jobs:
Bibliography:
install-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-tinytex@v2
- uses: actions/checkout@v3

- name: Install LaTeX packages
run: tlmgr install urlbst
- name: Restore System Dependencies Cache
uses: actions/cache@v3
id: system-deps-cache
with:
path: |
/usr/local/texlive
/usr/local/bin/pandoc
/usr/local/texlive/texmf-var
/usr/local/texlive/tlpkg/texlive.tlpdb
key: ${{ runner.os }}-system-deps-v1

- name: Install System Dependencies
if: steps.system-deps-cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra pandoc pandoc-citeproc
- uses: actions/cache@v3
id: r-packages-cache
with:
path: |
~/.cache/R
/usr/local/texlive
/usr/local/bin/pandoc
/usr/local/texlive/texmf-var
key: ${{ runner.os }}-r-${{ hashFiles('**/DESCRIPTION') }}-v1

- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
id: pandoc
with:
path: pandoc-2.19.2-1
key: pandoc-2.19.2-1
- name: Download pandoc-2.19.2-1-amd64.deb
if: steps.pandoc.outputs.cache-hit != 'true'
run: |
mkdir pandoc-2.19.2-1
cd pandoc-2.19.2-1
wget https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb
- name: Install pandoc
run: |
cd pandoc-2.19.2-1
sudo dpkg -i pandoc-2.19.2-1-amd64.deb
- uses: r-lib/actions/setup-r@v2

- name: Check pandoc version
run: pandoc --version
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
working-directory: rDNA/rDNA
extra-packages: |
any::devtools
any::testthat
any::ggplot2
any::roxygen2
any::igraph
any::ggraph
any::askpass
any::cluster
any::sna
any::ggrepel
any::coda
any::MCMCpack
any::tidygraph
any::heatmaply
any::factoextra
any::MASS
any::pbmcapply
Bibliography:
needs: install-dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-tinytex@v2
- uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/[email protected]

- name: Execute Gradle build for bibliography
run: ./gradlew :bibliography:build

- name: Store artifacts
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -68,33 +101,16 @@ jobs:
path: build/*.jar

rDNA:
needs: [DNA, install-dependencies]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
working-directory: rDNA/rDNA
extra-packages: |
any::ggplot2
any::roxygen2
any::igraph
any::ggraph
any::askpass
any::cluster
any::sna
- uses: gradle/wrapper-validation-action@v1

- name: Setup Gradle
uses: gradle/[email protected]

- name: Execute Gradle build for rDNA
run: ./gradlew :rDNA:build

- name: Store artifacts
uses: actions/upload-artifact@v3
with:
Expand All @@ -103,9 +119,8 @@ jobs:

rDNA-check:
runs-on: ${{ matrix.config.os }}

needs: rDNA
name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
Expand All @@ -115,29 +130,39 @@ jobs:
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
working-directory: rDNA/rDNA

- uses: r-lib/actions/check-r-package@v2
with:
working-directory: rDNA/rDNA
upload-snapshots: true

rDNA-test:
runs-on: ubuntu-latest
needs: [rDNA, install-dependencies]
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/[email protected]
- name: Execute Gradle rDNATest Task
run: ./gradlew :rDNA:rDNATest
- name: Store test results
uses: actions/upload-artifact@v3
with:
name: rDNA-Test-Results
path: build/reports/tests
9 changes: 9 additions & 0 deletions bibliography/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,15 @@ @article{starke2023green
doi={10.1016/j.jclepro.2023.139058}
}

@article{steemers2024united,
title={The {U}nited {K}ingdom's {R}ejoin Movement: A Post-{B}rexit Analysis of Framing Strategies},
author={Steemers, Kai},
journal={British Journal of Politics and International Relations},
year={2024},
doi={10.1177/13691481241269308},
note={Forthcoming}
}

@article{steinfeld2016f,
title={The {F}-Campaign: A Discourse Network Analysis of Party Leaders' Campaign Statements on {F}acebook},
author={Steinfeld, Nili},
Expand Down
28 changes: 27 additions & 1 deletion bibliography/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id 'base'
}

task bibliographyMarkdown {
inputs.dir '.'
doLast {
Expand Down Expand Up @@ -47,7 +51,7 @@ task bibliographyPdflatex {
}
}

task build {
build {
dependsOn bibliographyMarkdown
dependsOn bibliographyPdflatex
inputs.dir '.'
Expand All @@ -56,3 +60,25 @@ task build {

doLast {}
}

clean {
doFirst {
println "Attempting to delete bibliography files..."

def filesToDelete = fileTree(dir: "$rootDir/build", include: '**/bibliography.*').files
if (filesToDelete.isEmpty()) {
println "No bibliography files found to delete."
} else {
println "Found bibliography files to delete: "
filesToDelete.each { file ->
println file.absolutePath
}
}
}

delete fileTree(dir: "$rootDir/build", include: '**/bibliography.*')

doLast {
println "Bibliography files have been removed."
}
}
Loading

0 comments on commit 6f6639d

Please sign in to comment.