# Adding packages using GitHub Actions

**URL:** <https://discourse.julialang.org/t/adding-packages-using-github-actions/53789>\
**Category:** New to Julia\
**Created:** [January 22, 2021, 4:59pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789 "2021-01-22T16:59:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [January 22, 2021, 4:59pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/1 "2021-01-22T16:59:09Z")

</div>

I am just starting to use GitHub Actions. When running a `github_ci.yml` script via GitHub Actions I am getting the following error:

````julia

- Run `import Pkg; Pkg.add("BusinessDays")` to install the BusinessDays package.```

However the status list contais the BusinessDays package:
Status `/tmp/jl_V0rWWg/Manifest.toml`
  [56f22d72] Artifacts v1.3.0
  [4f18b42c] BusinessDays v0.9.12
  [9a962f9c] DataAPI v1.4.0 
   ...

One among many tries was: 
...
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- name: Install dependencies
  run: julia -e 'import Pkg; Pkg.add("BusinessDays")' 
...

I really don't know which command to use and even where in the script to put it. 

Thank you in advance.
````

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [January 22, 2021, 6:41pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/2 "2021-01-22T18:41:52Z")

</div>

Is the repository where you have this issue public? If yes, could you share the link? That would make debugging easier.

Normally, `julia-actions/julia-buildpkg@latest` should install all the required packages. I don’t know what you have tried exactly, but one possible error could be that your workflow contained something like

```julia
- name: Install dependencies
  run: julia -e 'import Pkg; Pkg.add("BusinessDays")' 
- name: Use BusinesDays
  run: julia --project -e 'using BusinessDays'

```

This won’t work because BusinessDays is installed in the global Julia workspace and not in your project.

In general,

```julia
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1

```

should install all the dependencies listed in `Project.toml` (and `Manifest.toml`), and make them available when running the tests.

---

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [January 22, 2021, 9:20pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/3 "2021-01-22T21:20:33Z")

</div>

Thank you very much! Sure, the link is the following [https://github.com/ASaragga/DayCounts.jl](https://github.com/ASaragga/DayCounts.jl).

It is forked from [JuliaFinance/DayCounts.jl](https://github.com/JuliaFinance/DayCounts.jl) with the addition of a few more day count conventions to make them a super set of the ones available in Matlab.

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [January 23, 2021, 9:50am UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/4 "2021-01-23T09:50:31Z")

</div>

I haven’t solved it yet, but I did manage to pin it down. The issue is not related to CI because I can reproduce it locally with

```julia
$ julia --project

(DayCounts) pkg> test

```

the issue is in “addbasis.jl” since commenting it out makes all the tests pass. On the other hand, running “addbasis.jl” on its own also works:

```julia
$ julia --project

julia> include("test/addbasis.jl")
Test Summary: | Pass Total
ActualActualMatlab | 18 18
Test Summary: | Pass Total
NL365 | 11 11
Test Summary: | Pass Total
Bus252 | 18 18
Test Summary: | Pass Total
Thirty360PSA | 14 14
Test Summary: | Pass Total
Thirty360SIA | 15 15
Test Summary: | Pass Total
ThirtyEPlus360 | 9 9
Test Summary: | Pass Total
ActualActualL | 16 16
Test Summary: | Pass Total
Actual365A | 10 10
Test Summary: | Pass Total
ActualActualY | 13 13
Test.DefaultTestSet("ActualActualY", Any[], 13, false)

```

---

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [January 23, 2021, 4:33pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/5 "2021-01-23T16:33:21Z")

</div>

Thank you so much for looking at this.

Indeed it is puzzling since if I comment out @testset `"Bus252"` that is the only place in the test set where `BusinessDays` is needed, I still get the same error.

---

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [January 23, 2021, 4:45pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/6 "2021-01-23T16:45:49Z")

</div>

Further, the complete test set file also runs without problems.

`julia> include("test/runtests.jl")`

```julia
Test Summary: | Pass Total
Actual365Fixed | 15 15
Test Summary: | Pass Total
Actual360 | 15 15
Test Summary: | Pass Total
ActualActualISDA | 15 15
Test Summary: | Pass Total
Thirty360 | 24 24
Test Summary: | Pass Total
ThirtyE360 | 24 24
Test Summary: | Pass Total
ThirtyE360ISDA | 48 48
Test Summary: | Pass Total
ActualActualICMA | 6 6
Test Summary: | Pass Total
ActuaActual ISDA Memo | 22 22
Test Summary: | Pass Total
Thirty360Excel | 24 24
Test Summary: | Pass Total
ActualActualExcel | 27 27
Test Summary: | Pass Total
ActualActualMatlab | 18 18
Test Summary: | Pass Total
NL365 | 11 11
Test Summary: | Pass Total
Bus252 | 18 18
Test Summary: | Pass Total
Thirty360PSA | 14 14
Test Summary: | Pass Total
Thirty360SIA | 15 15
Test Summary: | Pass Total
ThirtyEPlus360 | 9 9
Test Summary: | Pass Total
ActualActualL | 16 16
Test Summary: | Pass Total
Actual365A | 10 10
Test Summary: | Pass Total
ActualActualY | 13 13
Test Summary: | Pass Total
Excel basis 0 | 21 21
Test Summary: | Pass Total
Excel basis 1 | 21 21
Test Summary: | Pass Total
Excel basis 2 | 21 21
Test Summary: | Pass Total
Excel basis 3 | 21 21
Test Summary: | Pass Total
Excel basis 4 | 21 21
Test.DefaultTestSet("Excel basis 4", Any[], 21, false, false)

```

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [January 25, 2021, 12:56pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/7 "2021-01-25T12:56:29Z")

</div>

It’s odd; also that people on this forum don’t respond to this topic.

Is your goal to extend the original package? Maybe then it would be better to make a new package and move your code into there. That could solve the issue.

---

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [January 25, 2021, 5:37pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/8 "2021-01-25T17:37:09Z")

</div>

The problem is that, somehow, `Project.toml` in the - `test` - directory didn’t include `BusinessDays` as a dependency, although it was included as a dependency in `DayCounts' Project.toml`. So after doing the following the problem was solved:

```julia
julia> cd("test")
(DayCounts) pkg> activate .
   Activating environment at `~/Documents/GitHub/DayCounts.jl/test/Project.toml`
(test) pkg> add BusinessDays

```

Thank you very much for your help diagnosing the problem.

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [January 25, 2021, 6:15pm UTC](https://discourse.julialang.org/t/adding-packages-using-github-actions/53789/9 "2021-01-25T18:15:09Z")

</div>

Aha! Nice one. I did overlook that.

It’s best to remove `Project.toml` and `Manifest.toml` from the test directory; unless you have a good reason for having those files.
