Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gh deployment job. #479

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
5 changes: 5 additions & 0 deletions tests/testthat/test-get_commits-GitHub.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ test_that("`get_commits_from_one_repo()` prepares formatted list", {
})

test_that("`get_commits_from_repos()` pulls commits from repos", {
mockery::stub(
test_graphql_github$get_commits_from_repos,
"private$get_commits_from_one_repo",
test_mocker$use("commits_from_repo")
)
commits_from_repos <- test_graphql_github$get_commits_from_repos(
org = "r-world-devs",
repo = "GitStats",
Expand Down
27 changes: 27 additions & 0 deletions tests/testthat/test-get_files_content-GitHub.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,24 @@ test_that("get_repos_data pulls data on repos and branches", {
)
})

test_that("GitHub GraphQL Engine pulls file response", {
github_file_response <- test_graphql_github_priv$get_file_response(
org = "r-world-devs",
repo = "GitStats",
def_branch = "master",
file_path = "LICENSE",
files_query = test_mocker$use("gh_file_blobs_from_repo_query")
)
expect_github_files_response(github_file_response)
test_mocker$cache(github_file_response)
})

test_that("GitHub GraphQL Engine pulls files from organization", {
mockery::stub(
test_graphql_github$get_files_from_org,
"private$get_file_response",
test_mocker$use("github_file_response")
)
github_files_response <- test_graphql_github$get_files_from_org(
org = "r-world-devs",
repos = NULL,
Expand Down Expand Up @@ -53,6 +70,11 @@ test_that("GitHub GraphQL Engine pulls .png files from organization", {
})

test_that("GitHub GraphQL Engine pulls files from defined repositories", {
mockery::stub(
test_graphql_github$get_files_from_org,
"private$get_file_response",
test_mocker$use("github_file_response")
)
github_files_response <- test_graphql_github$get_files_from_org(
org = "openpharma",
repos = c("DataFakeR", "visR"),
Expand All @@ -67,6 +89,11 @@ test_that("GitHub GraphQL Engine pulls files from defined repositories", {
})

test_that("GitHub GraphQL Engine pulls two files from a group", {
mockery::stub(
test_graphql_github$get_files_from_org,
"private$get_file_response",
test_mocker$use("github_file_response")
)
github_files_response <- test_graphql_github$get_files_from_org(
org = "r-world-devs",
repos = NULL,
Expand Down
Loading