Skip to content

Commit

Permalink
chore: πŸ€– Save conda-env on test and small fixes (#138)
Browse files Browse the repository at this point in the history
* chore: πŸ€– Save conda-env on test and small fixes

Save the Conda environment to allow faster testing.
Add Conda related things to gitignore.
Fix ignored paths in copier.yml.

βœ… Closes: #137

* Don't make shallow clone in Test.yml

* Add a hack to fix tests on Windows
  • Loading branch information
abelsiqueira committed May 24, 2024
1 parent 22e031d commit bad2495
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
allow_failure: [false]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
*.rej
docs/build/
Manifest.toml
docs/CondaPkg.toml
test/CondaPkg.toml
test/conda-env
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
julia = "1.6"
CondaPkg = "0.2"
PythonCall = "0.9"
UUIDs = "1.6"
julia = "1.6"
3 changes: 0 additions & 3 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ UseCirrusCI:
_skip_if_exists:
- "**/*.jl"
- "!docs/make.jl"
- "**/*.md"
- "!docs/src/90-contributing.md"
- "!docs/src/90-developer.md"
- "**/Project.toml"
- CITATION.cff
- LICENSE
Expand Down
15 changes: 14 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# This is only useful for testing offline. It creates a local env to avoid redownloading things.
if get(ENV, "CI", "nothing") == "nothing"
ENV["JULIA_CONDAPKG_ENV"] = joinpath(@__DIR__, "conda-env")
if isdir(ENV["JULIA_CONDAPKG_ENV"])
ENV["JULIA_CONDAPKG_OFFLINE"] = true
end
end

using COPIERTemplate
using Test

Expand All @@ -22,7 +30,12 @@ template_options = Dict(
tmpdir1 = mktempdir()
tmpdir2 = mktempdir()

COPIERTemplate.generate(tmpdir1; data = template_options, vcs_ref = "main")
# This is a hack because Windows managed to dirty the repo.
if get(ENV, "CI", "nothing") == "true" && Sys.iswindows()
run(`git reset --hard HEAD`)
end

COPIERTemplate.generate(tmpdir1; data = template_options, vcs_ref = "HEAD")
bash_args = vcat([["-d"; "$k=$v"] for (k, v) in template_options]...)
ignore(line) = startswith("_commit")(line) || startswith("_src_path")(line)
template_path = joinpath(@__DIR__, "..")
Expand Down

0 comments on commit bad2495

Please sign in to comment.