Skip to content

Commit 6f6639d

Browse files
committed
Updated gradle, yml, rDNA tests+check
1 parent e926c38 commit 6f6639d

38 files changed

+538
-324
lines changed

.github/workflows/DNA build.yml renamed to .github/workflows/build-and-check.yml

Lines changed: 77 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,74 @@ name: build
33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
6-
Bibliography:
6+
install-dependencies:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
10-
- uses: r-lib/actions/setup-tinytex@v2
9+
- uses: actions/checkout@v3
1110

12-
- name: Install LaTeX packages
13-
run: tlmgr install urlbst
11+
- name: Restore System Dependencies Cache
12+
uses: actions/cache@v3
13+
id: system-deps-cache
14+
with:
15+
path: |
16+
/usr/local/texlive
17+
/usr/local/bin/pandoc
18+
/usr/local/texlive/texmf-var
19+
/usr/local/texlive/tlpkg/texlive.tlpdb
20+
key: ${{ runner.os }}-system-deps-v1
21+
22+
- name: Install System Dependencies
23+
if: steps.system-deps-cache.outputs.cache-hit != 'true'
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra pandoc pandoc-citeproc
27+
28+
- uses: actions/cache@v3
29+
id: r-packages-cache
30+
with:
31+
path: |
32+
~/.cache/R
33+
/usr/local/texlive
34+
/usr/local/bin/pandoc
35+
/usr/local/texlive/texmf-var
36+
key: ${{ runner.os }}-r-${{ hashFiles('**/DESCRIPTION') }}-v1
1437

15-
- uses: gradle/wrapper-validation-action@v1
16-
- uses: actions/cache@v3
17-
id: pandoc
18-
with:
19-
path: pandoc-2.19.2-1
20-
key: pandoc-2.19.2-1
21-
- name: Download pandoc-2.19.2-1-amd64.deb
22-
if: steps.pandoc.outputs.cache-hit != 'true'
23-
run: |
24-
mkdir pandoc-2.19.2-1
25-
cd pandoc-2.19.2-1
26-
wget https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb
27-
- name: Install pandoc
28-
run: |
29-
cd pandoc-2.19.2-1
30-
sudo dpkg -i pandoc-2.19.2-1-amd64.deb
38+
- uses: r-lib/actions/setup-r@v2
3139

32-
- name: Check pandoc version
33-
run: pandoc --version
40+
- uses: r-lib/actions/setup-r-dependencies@v2
41+
with:
42+
cache-version: 2
43+
working-directory: rDNA/rDNA
44+
extra-packages: |
45+
any::devtools
46+
any::testthat
47+
any::ggplot2
48+
any::roxygen2
49+
any::igraph
50+
any::ggraph
51+
any::askpass
52+
any::cluster
53+
any::sna
54+
any::ggrepel
55+
any::coda
56+
any::MCMCpack
57+
any::tidygraph
58+
any::heatmaply
59+
any::factoextra
60+
any::MASS
61+
any::pbmcapply
3462
63+
Bibliography:
64+
needs: install-dependencies
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v3
68+
- uses: r-lib/actions/setup-tinytex@v2
69+
- uses: gradle/wrapper-validation-action@v1
3570
- name: Setup Gradle
3671
uses: gradle/[email protected]
37-
3872
- name: Execute Gradle build for bibliography
3973
run: ./gradlew :bibliography:build
40-
4174
- name: Store artifacts
4275
uses: actions/upload-artifact@v3
4376
with:
@@ -68,33 +101,16 @@ jobs:
68101
path: build/*.jar
69102

70103
rDNA:
104+
needs: [DNA, install-dependencies]
71105
runs-on: ubuntu-latest
72106
steps:
73107
- uses: actions/checkout@v3
74-
75108
- uses: r-lib/actions/setup-r@v2
76-
77-
- uses: r-lib/actions/setup-r-dependencies@v2
78-
with:
79-
cache-version: 2
80-
working-directory: rDNA/rDNA
81-
extra-packages: |
82-
any::ggplot2
83-
any::roxygen2
84-
any::igraph
85-
any::ggraph
86-
any::askpass
87-
any::cluster
88-
any::sna
89-
90109
- uses: gradle/wrapper-validation-action@v1
91-
92110
- name: Setup Gradle
93111
uses: gradle/[email protected]
94-
95112
- name: Execute Gradle build for rDNA
96113
run: ./gradlew :rDNA:build
97-
98114
- name: Store artifacts
99115
uses: actions/upload-artifact@v3
100116
with:
@@ -103,9 +119,8 @@ jobs:
103119

104120
rDNA-check:
105121
runs-on: ${{ matrix.config.os }}
106-
122+
needs: rDNA
107123
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
108-
109124
strategy:
110125
fail-fast: false
111126
matrix:
@@ -115,29 +130,39 @@ jobs:
115130
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
116131
- {os: ubuntu-latest, r: 'release'}
117132
- {os: ubuntu-latest, r: 'oldrel-1'}
118-
119133
env:
120134
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
121135
R_KEEP_PKG_SOURCE: yes
122-
123136
steps:
124137
- uses: actions/checkout@v3
125-
126-
- uses: r-lib/actions/setup-pandoc@v2
127-
128138
- uses: r-lib/actions/setup-r@v2
129139
with:
130140
r-version: ${{ matrix.config.r }}
131141
http-user-agent: ${{ matrix.config.http-user-agent }}
132142
use-public-rspm: true
133-
134143
- uses: r-lib/actions/setup-r-dependencies@v2
135144
with:
136145
extra-packages: any::rcmdcheck
137146
needs: check
138147
working-directory: rDNA/rDNA
139-
140148
- uses: r-lib/actions/check-r-package@v2
141149
with:
142150
working-directory: rDNA/rDNA
143151
upload-snapshots: true
152+
153+
rDNA-test:
154+
runs-on: ubuntu-latest
155+
needs: [rDNA, install-dependencies]
156+
steps:
157+
- uses: actions/checkout@v3
158+
- uses: r-lib/actions/setup-r@v2
159+
- uses: gradle/wrapper-validation-action@v1
160+
- name: Setup Gradle
161+
uses: gradle/[email protected]
162+
- name: Execute Gradle rDNATest Task
163+
run: ./gradlew :rDNA:rDNATest
164+
- name: Store test results
165+
uses: actions/upload-artifact@v3
166+
with:
167+
name: rDNA-Test-Results
168+
path: build/reports/tests

bibliography/bibliography.bib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,6 +2828,15 @@ @article{starke2023green
28282828
doi={10.1016/j.jclepro.2023.139058}
28292829
}
28302830

2831+
@article{steemers2024united,
2832+
title={The {U}nited {K}ingdom's {R}ejoin Movement: A Post-{B}rexit Analysis of Framing Strategies},
2833+
author={Steemers, Kai},
2834+
journal={British Journal of Politics and International Relations},
2835+
year={2024},
2836+
doi={10.1177/13691481241269308},
2837+
note={Forthcoming}
2838+
}
2839+
28312840
@article{steinfeld2016f,
28322841
title={The {F}-Campaign: A Discourse Network Analysis of Party Leaders' Campaign Statements on {F}acebook},
28332842
author={Steinfeld, Nili},

bibliography/build.gradle

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id 'base'
3+
}
4+
15
task bibliographyMarkdown {
26
inputs.dir '.'
37
doLast {
@@ -47,7 +51,7 @@ task bibliographyPdflatex {
4751
}
4852
}
4953

50-
task build {
54+
build {
5155
dependsOn bibliographyMarkdown
5256
dependsOn bibliographyPdflatex
5357
inputs.dir '.'
@@ -56,3 +60,25 @@ task build {
5660

5761
doLast {}
5862
}
63+
64+
clean {
65+
doFirst {
66+
println "Attempting to delete bibliography files..."
67+
68+
def filesToDelete = fileTree(dir: "$rootDir/build", include: '**/bibliography.*').files
69+
if (filesToDelete.isEmpty()) {
70+
println "No bibliography files found to delete."
71+
} else {
72+
println "Found bibliography files to delete: "
73+
filesToDelete.each { file ->
74+
println file.absolutePath
75+
}
76+
}
77+
}
78+
79+
delete fileTree(dir: "$rootDir/build", include: '**/bibliography.*')
80+
81+
doLast {
82+
println "Bibliography files have been removed."
83+
}
84+
}

0 commit comments

Comments
 (0)