-
Notifications
You must be signed in to change notification settings - Fork 25
ci: Use with-connect action for integration tests
#475
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
Changes from all commits
117846d
3648913
68e6c4e
dc6dd77
d118dde
e53a42f
6137c4c
f6eb1c9
1712079
e98bb82
eb99b3b
a64161c
35c9a2b
e32ac72
0aef98d
3e16050
e11e33e
066f11f
b845160
ca8634f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,35 +15,29 @@ jobs: | |
| fail-fast: false | ||
| matrix: | ||
| version: | ||
| - "jammy" # As long as we're building on ubuntu 22.04, this will track the latest release | ||
| - "2025.09.0" # jammy | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can also add
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, |
||
| - "2025.03.0" # jammy | ||
| - "2024.09.0" # jammy | ||
| - "2024.03.0" # jammy | ||
| - "2023.09.0" # jammy | ||
| - "2023.03.0" # bionic | ||
| - "2022.09.0" # bionic | ||
| - "2022.03.2" | ||
| - "2021.09.0" | ||
| - "1.8.8.2" | ||
| - "2022.10.0" # bionic | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because |
||
| name: Connect ${{ matrix.version }} | ||
|
|
||
| env: | ||
| CONNECT_VERSION: ${{ matrix.version }} | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| CONNECT_LICENSE_FILE: ${{ secrets.CONNECT_LICENSE_FILE }} | ||
| CONNECTAPI_INTEGRATED: true | ||
|
|
||
| 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::rcmdcheck, local::. | ||
| needs: check | ||
| extra-packages: local::. | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for cleaning this up |
||
|
|
||
| - name: Session info | ||
| run: | | ||
|
|
@@ -52,24 +46,18 @@ jobs: | |
| sessioninfo::session_info(pkgs, include_base = TRUE) | ||
| shell: Rscript {0} | ||
|
|
||
| - name: Set up license file | ||
| run: echo "$CONNECT_LICENSE_FILE" > /tmp/connect.lic | ||
|
|
||
| - name: Setup test environment | ||
| run: | | ||
| connectapi:::build_test_env(connect_license_path = "/tmp/connect.lic") | ||
| shell: Rscript {0} | ||
|
|
||
| - uses: r-lib/actions/check-r-package@v2 | ||
|
|
||
| - name: Show testthat output | ||
| if: always() | ||
| run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
| shell: bash | ||
|
|
||
| - name: Upload check results | ||
| if: failure() | ||
| uses: actions/upload-artifact@main | ||
| - name: Run integration tests | ||
| uses: nealrichardson/with-connect@dev | ||
| env: | ||
| CONNECTAPI_INTEGRATED: "true" | ||
| with: | ||
| name: ${{ runner.os }}-${{ matrix.version }}-results | ||
| path: check | ||
| version: ${{ matrix.version }} | ||
| license: ${{ secrets.CONNECT_LICENSE_FILE }} | ||
| # TODO: rewrite tests to use CONNECT_* env vars directly | ||
| command: | | ||
| Rscript -e ' | ||
| Sys.setenv( | ||
| TEST_1_SERVER=Sys.getenv("CONNECT_SERVER"), | ||
| TEST_1_API_KEY=Sys.getenv("CONNECT_API_KEY") | ||
| ) | ||
| source("tests/test-integrated.R")' | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,8 +18,6 @@ jobs: | |||||
| runs-on: ubuntu-latest | ||||||
| env: | ||||||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||||||
| CONNECT_VERSION: 2024.03.0 | ||||||
| CONNECT_LICENSE_FILE: ${{ secrets.CONNECT_LICENSE_FILE }} | ||||||
|
|
||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
|
@@ -35,16 +33,19 @@ jobs: | |||||
| extra-packages: any::pkgdown, local::. | ||||||
| needs: website | ||||||
|
|
||||||
| - name: Set up license file | ||||||
| run: echo "$CONNECT_LICENSE_FILE" > /tmp/connect.lic | ||||||
|
|
||||||
| - name: Start Connect | ||||||
| run: | | ||||||
| Rscript -e 'connectapi:::build_test_env(connect_license_path = "/tmp/connect.lic")' | ||||||
|
|
||||||
| - name: Build site | ||||||
| run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | ||||||
| shell: Rscript {0} | ||||||
| uses: nealrichardson/with-connect@dev | ||||||
| with: | ||||||
| # Runs on the default version in the with-connect action | ||||||
| license: ${{ secrets.CONNECT_LICENSE_FILE }} | ||||||
| # TODO: rewrite tests to use CONNECT_* env vars directly | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe reference the issue in this line, or just remove it since we have the issue?
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Morally I agree, but I'm just going to do this once this PR lands, so I won't forget |
||||||
| command: | | ||||||
| Rscript -e ' | ||||||
| Sys.setenv( | ||||||
| TEST_1_SERVER=Sys.getenv("CONNECT_SERVER"), | ||||||
| TEST_1_API_KEY=Sys.getenv("CONNECT_API_KEY") | ||||||
| ) | ||||||
| pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)' | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a followup that will remediate the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
|
|
||||||
| - name: Deploy to GitHub pages 🚀 | ||||||
| if: github.event_name != 'pull_request' | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,55 +7,6 @@ on: | |
| name: Commands | ||
|
|
||
| jobs: | ||
| update_snapshot: | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is ever used. |
||
| if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/snapshot') }} | ||
| name: snapshot | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| CONNECT_VERSION: 2024.03.0 | ||
| CONNECT_LICENSE_FILE: ${{ secrets.CONNECT_LICENSE_FILE }} | ||
| CONNECTAPI_INTEGRATED: true | ||
| 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::covr, local::. | ||
| needs: coverage | ||
|
|
||
| - name: Set up license file | ||
| run: echo "$CONNECT_LICENSE_FILE" > /tmp/connect.lic | ||
|
|
||
| - name: Setup test environment | ||
| run: | | ||
| connectapi:::build_test_env(connect_license_path = "/tmp/connect.lic") | ||
| shell: Rscript {0} | ||
|
|
||
| - uses: r-lib/actions/check-r-package@v2 | ||
|
|
||
| - name: Accept Snapshots | ||
| run: | | ||
| testthat::snapshot_accept(path = "tests/testthat") | ||
| testthat::snapshot_accept(path = "tests/integrated") | ||
|
|
||
| - name: Commit results | ||
| run: | | ||
| set -xe | ||
| git config --local user.name "$GITHUB_ACTOR" | ||
| git config --local user.email "[email protected]" | ||
| git commit tests/**/_snaps || echo "No changes to commit" | ||
|
|
||
| - uses: r-lib/actions/pr-push@v2 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| document: | ||
| if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} | ||
| name: document | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳