Hi folks. I’ve put together a package for my Advent of Code. The unit tests pass locally but fail when run through my simple GitHub Actions workflow:
name: Run tests for AOC2021
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: 1.7
- uses: julia-actions/julia-buildpkg@latest
with:
project: "AOC2021"
- uses: julia-actions/julia-runtest@latest
with:
project: "AOC2021"
You’ll notice that the project is a subdirectory of the git repository.
The tests fail because Julia can’t find the submodules I use for each day, like Day01
, which makes me think I’m misunderstanding how scoping works (something I often struggle with). The unit tests use imports like import AOC2021.Day06.part1
, where part1
is a function of the submodule Day06
.
When I run the unit tests locally, I do so by navigating to the parent directory and running julia --project=AOC2021 -e 'import Pkg;Pkg.test()'
, which is similar to the command run by the GA workflow. There are no issues locally.
Can someone please help me identify what’s going wrong here?