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

service name for tic #306

Open
helgasoft opened this issue Oct 29, 2021 · 3 comments
Open

service name for tic #306

helgasoft opened this issue Oct 29, 2021 · 3 comments

Comments

@helgasoft
Copy link

Glad to find 'tic' and like the simplicity and abstraction. 👍
It is working great for code testing, but I'm having a problem with test coverage .
My provider is coveralls.io and I'm trying to set it up in YAML. The covr::coveralls call is expecting a service name with default 'travis-ci'. I cannot use the default, or 'tic'. My understanding is that GitHub Actions is the actual service, but what would be the correct name ?

#> tic::use_tic(wizard = FALSE, linux = "ghactions", mac = "ghactions", 
#               windows = "ghactions", deploy = "ghactions", matrix = "none")
#> Done! Thanks for using tic.

# ---------- my test-coverage.yaml 
    steps:  ...
      - name: Test coverage
        run: covr::coveralls( service_name = ??? )
        shell: Rscript {0}

Thank you in advance for your guidance.

@pat-s
Copy link
Member

pat-s commented Oct 30, 2021

Great that you like the project.

The main idea is to have all calls in tic.R, in a language-agnostic way.
The YAML files should usually not be changed.

You would want to do something like

add_code_step(covr::coveralls(service_name = ???))

@helgasoft
Copy link
Author

Wish it was that simple. Here is the solution.
Could tic replicate that?

  • eventually the three name steps with add_code_step() ?
  • gha_add_secret() for COVERALLS_API ?

But can tic write to the environment, in env section? There is ci_get_env to read, but could not find any command to write.
Would be great to have full control thru tic.R

@pat-s
Copy link
Member

pat-s commented Oct 31, 2021

You can write arbitrary R code in add_code_step() and hence also reference env vars (e.g. COVERALLS_TOKEN).

But can tic write to the environment, in env section?

You can/should define additional env vars derived from secrets in the GHA YAML, yes. Then you can reference them in builds.

I think what you want is something like add_code_step(covr::coveralls(service_name = ci_get_env("COVERALLS_TOKEN"))).

gha_add_secret() is a wrapper for adding secrets into GHA, not for managing them throughout the build. If there is something unclear in the documentation of this one, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants