diff --git a/.buildkite/jobscript.sh b/.buildkite/jobscript.sh new file mode 100755 index 0000000..c882629 --- /dev/null +++ b/.buildkite/jobscript.sh @@ -0,0 +1,16 @@ +#!/bin/bash +#SBATCH --job-name=diagrammatic_equations_CI # Job name +#SBATCH --mail-type=END,FAIL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=cuffaro.m@ufl.edu # Where to send mail +#SBATCH --ntasks=1 # Run on a single CPU +#SBATCH --mem=8gb # Job memory request +#SBATCH --time=00:15:00 # Time limit hrs:min:sec +pwd; hostname; date + +module load julia + +echo "Running Tests..." +julia --project -t 32 -e 'using Pkg; Pkg.status(); Pkg.test()' + +echo "Building Documentation..." +julia --project=docs -t 32 -e'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.status(); Pkg.instantiate(); include("docs/make.jl")' diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000..63e3ca3 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,20 @@ +env: + JULIA_VERSION: "1.9.3" + +steps: + + - label: ":hammer: Build Project" + command: + - "module load julia" + - "julia --project=docs --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()'" + + - wait + + - label: ":scroll: Build docs and run tests" + command: + - "srun --cpus-per-task=32 --mem=8G --time=1:00:00 --output=.buildkite/log_%j.log --unbuffered .buildkite/jobscript.sh" + env: + JULIA_PROJECT: "docs/" + + - wait + diff --git a/README.md b/README.md index 506387e..2f0df12 100644 --- a/README.md +++ b/README.md @@ -27,32 +27,14 @@ A template repository for making a new AlgebraicJulia package. git clone https://github.com/AlgebraicJulia/AlgebraicX.jl.git cd AlgebraicX.jl ``` -5. Rename the file `src/AlgebraicTemplate.jl` to match the name of your new package (e.x. "AlgebraicX") - ```sh - mv src/AlgebraicTemplate.jl src/AlgebraicX.jl - ``` -6. Replace all instances of the word "AlgebraicTemplate" with your new package name (e.x. "AlgebraicX") - ```sh - # On linux - git grep -l 'AlgebraicTemplate' | xargs sed -i 's/AlgebraicTemplate/AlgebraicX/g' - # On Mac OS X - git grep -l 'AlgebraicTemplate' | xargs sed -i '' -e 's/AlgebraicTemplate/AlgebraicX/g' - ``` -7. Generate a new random version 4 UUID (you can get one here: https://www.uuidgenerator.net/version4) - - We will assume for this example that your new UUID is `` -8. Replace all instances of the template's UUID, "b66562e1-fa90-4e8b-9505-c909188fab76", with your new UUID (e.x. "") - ```sh - # On linux - git grep -l 'b66562e1-fa90-4e8b-9505-c909188fab76' | xargs sed -i 's/b66562e1-fa90-4e8b-9505-c909188fab76//g' - # On Mac OS X - git grep -l 'b66562e1-fa90-4e8b-9505-c909188fab76' | xargs sed -i '' -e 's/b66562e1-fa90-4e8b-9505-c909188fab76//g' - ``` -9. Commit these new changes to your repository - ```sh - git commit -am "Set up skeleton for AlgebraicX.jl" - git push - ``` -10. Go back to your repository and wait until the tests have passed, you can check the status by going to the "Actions" tab in the repository +5. Inspect for yourself and run `init.sh` with the new repository name and (optional) UUID are parameters. This script will substitute all instances of `AlgebraicX` with your new repository name and the default UUID with a new one or, if available, the UUID provided. +6. Go back to your repository and wait until the tests have passed, you can check the status by going to the "Actions" tab in the repository + +### Buildkite + +AlgebraicJulia uses [Buildkite](https://buildkite.com/) to submit resource-intensive processes such as building documentation and executing tests to the [HiPerGator](https://www.rc.ufl.edu/about/hipergator/) computing cluster. + +While this template comes with a preconfigured `.buildkite/pipeline.yml` file, this repository is not integrated with Buildkite by default. If you would like your repository to use Buildkite to run processes on HiPerGator, tag an issue with @AlgebraicJulia/SysAdmins. ### 📔 Set Up GitHub Pages (Public Repos Only) diff --git a/init.sh b/init.sh new file mode 100644 index 0000000..f16c75a --- /dev/null +++ b/init.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +DEFAULT_REPO='AlgebraicTemplate' +DEFAULT_UUID='b66562e1-fa90-4e8b-9505-c909188fab76' + +usage="This script is for initializing the template with the new repository name and UUID. Please provide the new repository name and UUID in that order. The repository name cannot be 'Test.'\n +Example:\n +./init.sh ${DEFAULT_REPO} ${DEFAULT_UUID}" + +REPO={$1:-$(echo "${PWD##*/}")} +UUID=${2:-$(uuidgen)} + +# set to lowercase +UUID=${UUID,,} + +if [ ! $REPO ] || [ "$REPO" = 'Test' ] || [ ! $UUID ]; then + echo "" + printf "$usage" + exit 1 +fi + +read -p "By continuing, the following substitutions will be made: + +REPO: $DEFAULT_REPO => $REPO +UUID: $DEFAULT_UUID => $UUID + +Are you sure? [y/N]" -n 1 -r -s +echo + +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + exit 1 +fi + +echo "Doing the thing..." + +# get version +unameOut="$(uname -s)" + +case "${unameOut}" in + Linux*) + git grep -l $DEFAULT_REPO | xargs sed -i "s/${DEFAULT_REPO}/${REPO}/g"; + git grep -l $DEFAULT_UUID | xargs sed -i "s/${DEFAULT_UUID}/${UUID}/g";; + Darwin*) + git grep -l $DEFAULT_REPO | xargs sed -i '' -e "s/${DEFAULT_REPO}/${REPO}/g"; + git grep -l $DEFAULT_UUID | xargs sed -i '' -e "s/${DEFAULT_UUID}/${UUID}/g";; + *) + echo UNKNOWN:${unameOut};; +esac + +# rename +if [[ $REPO == *.jl ]] +then + mv src/$DEFAULT_REPO.jl src/$REPO +else + mv src/$DEFAULT_REPO.jl src/$REPO.jl +fi + +read -p "Would you like this script to add, commit, and push the new changes? [y/N]" -n 1 -r -s +echo + +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + exit 1 +fi + +git commit -am "Initialized $REPO" +git push