Skip to content

Commit

Permalink
Merge branch 'chemCode' into srsHacks
Browse files Browse the repository at this point in the history
Remove mulRe from chemCode (see JacquesCarette#3812)
  • Loading branch information
samm82 committed Jun 28, 2024
2 parents a950636 + 0e06deb commit f9df151
Show file tree
Hide file tree
Showing 643 changed files with 15,903 additions and 5,029 deletions.
58 changes: 43 additions & 15 deletions .github/workflows/Build.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
on:
push:
paths: [code/**]
pull_request:
branches: master
branches: main
paths: [code/**]
workflow_dispatch:
name: Build
defaults:
run:
shell: bash
working-directory: code
env:
is_deployment: ${{ github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
is_deployment: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
jobs:
auto-cancel:
if: |
github.event_name == 'pull_request'
|| github.event_name == 'workflow_dispatch'
|| (github.event_name == 'push' && (github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, '[workflow-trigger]')))
|| (github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.event.head_commit.message, '[workflow-trigger]')))
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
build:
Expand All @@ -28,19 +30,31 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: "Update apt package list"
run: |
sudo apt-get update
- name: "Search changes for applicable tests"
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
tex:
- 'code/stable/**/*.tex'
- name: "Install system requirements"
run: sudo apt-get install -y --fix-missing libgmp-dev python3 graphviz doxygen fonts-lmodern texlive-bibtex-extra texlive-latex-extra texlive-science texlive-xetex texlive-luatex g++ default-jdk mono-devel inkscape

- name: "Install Stack"
uses: haskell/actions/setup@v2
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
stack-version: 'latest'

- name: "Cache dependencies"
uses: actions/cache@v3.3.2
uses: actions/cache@v4.0.2
with:
path: |
~/.stack
Expand All @@ -50,57 +64,71 @@ jobs:
code/website/.stack-work/
~/.local/bin/graphmod
key: ${{ runner.os }}-store-${{ hashFiles('code/stack.yaml') }}

- name: "Clean previous run"
run: make clean

- name: "Update PATH"
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.swift/usr/bin" >> $GITHUB_PATH
- name: "Install dependencies"
run: make stackArgs="--no-terminal" deps

- name: "Build"
run: make code stackArgs="--no-terminal" GHCFLAGS="-Werror"

- name: "Test built artifacts against stable"
run: make stackArgs="--no-terminal" GHCFLAGS="-Werror" NOISY=yes

- name: "Compile GOOL examples"
run: make codegenTest

- name: "Compile generated TeX artifacts"
run: make tex SUMMARIZE_TEX=yes
if: steps.changes.tex.src == 'true'

- name: "Compile generated software artifacts"
run: make gool

- name: "Create Doxygen for generated software artifacts"
run: make doxygen

- name: "Generate Haddock docs (as test)"
run: make docs
if: ${{ !fromJSON(env.is_deployment) }}

- name: "Generate Haddock docs (full + std)"
run: FULL=1 make docs
if: ${{ fromJSON(env.is_deployment) }}

- name: "Generate module dependency graphs"
run: make graphs

- name: "Analyze Drasil code"
run: make analysis

- name: "Convert analysis graphs into dot and circo SVGs" # only needed in deployments, not required for tests
run: make convertAnalyzed
if: ${{ fromJSON(env.is_deployment) }}

- name: "Build website generator"
run: make website

- name: "Test Built Website against Stable Version"
run: make test_website NOISY=yes
- name: "Build website"
run: |
LABEL_FILE=/tmp/ci_build_failures \
MANAGED_LABEL_FILE=/tmp/ci_managed_labels \
ALL_FUNCTIONS_FILE=$(mktemp) \
SHELL_OPTS_FILE=$(mktemp) \
bash scripts/deploy_wrapper.bash

- name: "Prepare full website deployment environment"
run: make deploy_lite

- name: "Deploy 🚀"
if: ${{ fromJSON(env.is_deployment) }}
uses: JamesIves/github-pages-deploy-action@v4.4.3
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
git-config-name: ${{ secrets.BOT_NAME }}
git-config-email: ${{ secrets.BOT_EMAIL }}
token: ${{ secrets.BOT_TOKEN }}
branch: gh-pages
folder: code/deploy
commit-message: "${{ secrets.BOT_NAME }} deploy of master@${{ github.sha }}"
commit-message: "${{ secrets.BOT_NAME }} deploy of main@${{ github.sha }}"
2 changes: 1 addition & 1 deletion .github/workflows/Lint.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
pull_request:
branches: master
branches: main
paths: 'code/drasil-**'
name: Linter
concurrency:
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/Wiki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Wiki
on:
push:
branches: [main]
paths: [wiki/**, .github/workflows/Wiki.yaml]
pull_request:
branches: [main]
paths: [wiki/**, .github/workflows/Wiki.yaml]
permissions:
contents: write
jobs:
check_directories:
name: "Audit changes"
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "No new directories in ./wiki/"
run: |
if git diff --name-only --diff-filter=A origin/main... | grep -q '^wiki/.*/'; then
echo "New directory detected in wiki folder. This is not allowed."
exit 1
fi
- name: "No manually added disclaimers"
run: |
notice='Warning: Wiki should not be edited directly'
bad_files=$(grep -rl "$notice" wiki || true)
if [ -n "$bad_files" ]; then
echo "Edit disclaimers are automatically prepended. Please remove those manually added. Bad files:"
echo "$bad_files"
exit 1
fi
- name: "Windows-friendly file names"
run: |
bad_file_names=$(find wiki -type f -name "*[\\/:*?\"<>|]*")
if [ -n "$bad_file_names" ]; then
echo "Windows-friendly file names must not contain any of \"\\/:*?\"<>|\". Bad files:"
echo "$bad_file_names"
exit 1
fi
wiki:
name: "Publish changes"
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with: # Fetch enough history to resolve HEAD^ -- https://github.com/actions/checkout?tab=readme-ov-file#checkout-head
fetch-depth: 2

- name: "Configure git client"
run: |
git config --global user.name "${{ secrets.BOT_NAME }}"
git config --global user.email "${{ secrets.BOT_EMAIL }}"
- name: "Prepend wiki edit warnings"
run: |
notice='_Warning: Wiki should not be edited directly. Edit the files in the ./wiki/ folder instead and make a PR._'
for file in wiki/*.md; do
[ "$(basename "$file")" = "_Sidebar.md" ] && continue
sed -i '1s|^|'"$notice"'\n\n|' "$file"
done
- name: "Clone .wiki repository"
run: |
git clone https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/${{ github.repository }}.wiki.git
- name: "Update ~.wiki.git contents"
run: |
rsync -av --delete --exclude '.git' wiki/ ${GITHUB_REPOSITORY##*/}.wiki/
- name: "Commit and push changes"
run: |
cd ${GITHUB_REPOSITORY##*/}.wiki
git add .
if [ -n "$(git status --porcelain)" ]; then
git commit -m "Update wiki content at ${{ github.sha }}"
git push origin master
else
echo "No changes to commit"
fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ desktop.ini
# Editors
.idea
.vscode
.direnv

# Drasil/Haskell
*.cabal
Expand All @@ -24,6 +25,7 @@ dist
stack.yaml.lock
.hlint*
.envrc
.hie

# Drasil supported programming languages
__pycache__
Expand Down
87 changes: 87 additions & 0 deletions People/Brandon-Bosman/genRendererTemplate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
## Purpose: generates a template with unimplemented instances of all the classes
# in the target file.
# Instructions: Modify the strings under # Inputs: inFilePath, outFilePath, oldName, newName.
# inFilePath should be a path to an existing renderer (e.g. SwiftRenderer.hs)
# oldName should be the name of the main type for the existing renderer (e.g. SwiftRenderer)
# newFilePath and newName should be pretty self-explanatory.
# Then run the file with your python3 interpreter.
# Created by Brandon Bosman
# Date: May 16, 2024

# Inputs
inFilePath = "drasil-gool/lib/GOOL/Drasil/LanguageRenderer/SwiftRenderer.hs"
outFilePath = "drasil-gool/lib/GOOL/Drasil/LanguageRenderer/TemplateJuliaRenderer.hs"
oldName = "SwiftCode"
newName = "JuliaCode"

# The datatype for an instance: it has a declaration, some types, and some methods
def newInstance(line: str):
return {
"declaration" : line.replace(oldName, newName),
"types" : [],
"methods" : []
}

# Read file
with open(inFilePath, "r") as inFile:
lines = inFile.readlines()

# Go through lines and find instances of typeclasses
instances = []
inInstance = False

for line in lines:

# Detect an instance declaration
if line.startswith("instance"):
inInstance = True
instances.append(newInstance(line))
continue

if inInstance:

# Unindented code means the current instance is finished
if not line.isspace() and not line.startswith(" "):
inInstance = False
print("Not instance: " + line)
continue

# Skim over blank lines and lines indented more than once
if line.isspace():
print("All space: " + line)
continue

if len(line) > 2 and line[2] == " ":
print("Nested indent: " + line)
continue

start = 2 # the first character after the indent

# Add types and methods
if line[start:].startswith("type"):
instances[-1]["types"].append(line.replace(oldName, newName))
else:
# Add everything before the 'main' = sign ('main' determined by
# brackets), then add undefined after the = sign.
end = start + 1
brackets = 0
while end <= len(line) and (line[end-1] != "=" or brackets != 0):
if line[end-1] == "(":
brackets += 1
elif line[end-1] == ")":
brackets -= 1
end += 1
instances[-1]["methods"].append(line[0:end] + " undefined")

# Output findings
with open(outFilePath, "w") as outFile:
outFile.write("")

with open(outFilePath, "a") as outFile:
for instance in instances:
outFile.write(instance["declaration"])
for type in instance["types"]:
outFile.write(type + "\n")
for method in instance["methods"]:
outFile.write(method + "\n")
outFile.write("\n")
4 changes: 2 additions & 2 deletions People/Jason/thesis/chapters/03_drasil.tex
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ \section{What is it? What can it do?}
the knowledge capture is the reusability of it to regenerate artifacts in
different, but similarly applicable, languages. For example, the \acs{glassbr}
case study had \porthref{software
artifacts}{https://github.com/smiths/caseStudies/tree/master/CaseStudies/glass}
artifacts}{https://github.com/smiths/caseStudies/tree/main/CaseStudies/glass}
manually built. Once the knowledge was codified in Drasil, the same knowledge
allows re-creation in \porthref{other
languages}{https://github.com/JacquesCarette/Drasil/tree/master/code/stable/glassbr}.
languages}{https://github.com/JacquesCarette/Drasil/tree/main/code/stable/glassbr}.

\roughNetworkOfDomains{}

Expand Down
2 changes: 1 addition & 1 deletion People/Jason/thesis/front/reading_notes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ \chapter{Reading Notes}
and a guide for \porthref{building your own project with
Drasil}{https://github.com/JacquesCarette/Drasil/wiki/Creating-Your-Project-in-Drasil}.
Similarly, the \porthref{source
code}{https://github.com/JacquesCarette/Drasil/tree/master/People/Jason/thesis}
code}{https://github.com/JacquesCarette/Drasil/tree/main/People/Jason/thesis}
for this thesis is also publicly available.

\item ``Source Code'' snippets with ``Original'' in their title show code
Expand Down
2 changes: 1 addition & 1 deletion People/Jason/thesis/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ @unpublished{well-understood
note = {Submitted Nov 2021 to NIER - New Ideas and Emerging Results (ICSE 2022)},
title = {When Capturing Knowledge Improves Productivity},
year = {2021},
url = {https://github.com/JacquesCarette/Drasil/blob/master/Papers/WellUnderstood/wu.pdf}
url = {https://github.com/JacquesCarette/Drasil/blob/main/Papers/WellUnderstood/wu.pdf}
}

@misc{wiki:Vasa_ship,
Expand Down
1 change: 1 addition & 0 deletions People/Mohd-Bilal/projectileSRS-mdBook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
Loading

0 comments on commit f9df151

Please sign in to comment.