This is a multi-language repository, for easy usage, all of them share the same root level. You need to individually set up each language you wish to use.
The repository does not contain task inputs as my own inputs are located in a private repository. If you wish to use this repository with your own inputs provide them in the following folder structure:
resources
├── 2015
│ ├── 01
│ │ └── input.txt
│ ├── 02
│ │ └── input.txt
│ │ ...
│ └── 25
│ └── input.txt
│ ...
└── 2024
├── 01
│ ├── example.1.txt
│ ├── example.2.txt
│ └── input.txt
│ ...
└── 25
└── input.txt
Reference for myself, cloning with my private inputs
git clone --recurse-submodules -j8 [email protected]:AlexAegis/advent-of-code.git
Install latest stable node
and pnpm
pnpm install
# Navigate to the solution
cd solutions/typescript/2024/01
pnpm p1
pnpm p2
Open the solutions file, then run the [TS] Current File
debug profile.
pnpm test
# Navigate to the solution
cd solutions/typescript/2024/01
pnpm test
# Navigate to the solution
cd solutions/typescript/2024/01
pnpm bench
pnpm lint
# Navigate to the solution
cd solutions/typescript/2024/01
pnpm lint:tsc
pnpm lint:es
pnpm lint:format
Install latest stable python
and pipenv
pipenv install
pipenv shell
If you wish to replicate the same input setup that I have so that it's compliant with Advent of Code's rules, you should not keep your inputs in a publicly hosted repository. I think the best solution to this is to keep them in a private submodule, keeping your inputs private, but your solutions public and keeping your CI happy and operational.
See the "Can I copy/redistribute part of Advent of Code?" section at https://adventofcode.com/2023/about
-
Collect your input files into a new "advent-of-code-inputs" repository
-
Get a fresh clone of your repository!
-
You will completely rewrite your repository's history, so first educate yourself on how
git-filter-repo
works. (The tool you might find for this first is the BFG Repo cleaner, however git-filter-repo is much more capable and can clean out huge repositories in just milliseconds.) -
Clean out the repository:
git filter-repo --invert-paths --path-glob '*.txt' --path inputs
This is just an example command, add more globs or paths if needed
-
Verify that apart from the unwanted files everything is in order. Check older commits too!
Maybe in previous years you stored these files differently, and/or you refactored them at some point!
-
Add back your inputs as a git submodule:
git submodule add [email protected]:AlexAegis/advent-of-code-inputs.git resources git commit -m 'added inputs submodule'
-
Adjust your CI so that it checks out submodules too.
If you're using GitHub Actions and actions/checkout:
- name: checkout uses: actions/checkout@v4 with: fetch-depth: 1 submodules: true
-
Verify if everything works locally
-
If everything looks right, re-add your remote and force push the changes. (Since you started with a fresh clone, your old can be used to restore it if anything goes wrong at any point)
git remote add origin [email protected]:AlexAegis/advent-of-code.git git push --force
-
Clean out remaining branches by either force pushing them too or just removing them.
Advent of Code is made by Eric Wastl.