Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Initial commit

Signed-off-by: Gabriel Mocanu <[email protected]>
  • Loading branch information
gabrielmocanu committed Feb 20, 2024
0 parents commit bad1a7f
Show file tree
Hide file tree
Showing 50 changed files with 1,829 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
topic/template-chapter:
- chapters/template-chapter/**/*

topic/another-chapter:
- chapters/another-chapter/**/*

area/reading:
- '**/reading/*'
- '**/reading/**/*'

area/media:
- '**/media/*'
- '**/media/**/*'

area/slides:
- '**/slides/*'
- '**/slides/**/*'

area/guides:
- '**/guides/*'
- '**/guides/**/*'

area/drills:
- '**/drills/*'
- '**/drills/**/*'

area/projects:
- '**/projects/*'
- '**/projects/**/*'

area/infra:
- 'common/*'
- 'common/**/*'
- 'scripts/*'
- 'scripts/**/*'
- '.github/*'
- '.github/**/*'
- 'Dockerfile'
- 'Makefile'
- 'config.yaml'
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Prerequisite Checklist

<!--
Please mark items appropriately:
-->

- [ ] Read the [contribution guidelines](https://github.com/open-education-hub/ccas-internal/blob/main/CONTRIBUTING.md#pull-requests) regarding submitting new changes to the project;
- [ ] Tested your changes against relevant architectures and platforms;
- [ ] Updated relevant documentation (if needed).

## Description of changes

<!--
Please provide a detailed description of the changes made in this new PR.
-->
34 changes: 34 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Linter Actions Workflow

on:
pull_request:
branches:
- main

jobs:
checkpatch:
name: Checkpatch
runs-on: ubuntu-latest
steps:
- name: Checkpatch
uses: open-education-hub/actions/checkpatch@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

super-linter:
name: Super Linter
runs-on: ubuntu-latest
steps:
- name: Super Linter
uses: open-education-hub/actions/super-linter@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

spellcheck:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- name: Spellcheck
uses: open-education-hub/actions/spellcheck@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: OpenEduHub - Github Page

on:
push:
branches:
- main # Set a branch to deploy

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
path: ./repo

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./repo
file: ./repo/Dockerfile
push: false
load: true
tags: hardware-software-interface-oer/docusaurus:latest
cache-from: type=gha
cache-to: type=gha

- name: Load image
run: |
mkdir output
docker image list
docker run -v $GITHUB_WORKSPACE/repo:/content -v $GITHUB_WORKSPACE/output:/output hardware-software-interface-oer/docusaurus:latest
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./output
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
publish_branch: gh-pages
16 changes: 16 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Labeler Actions Workflow

on:
schedule:
- cron: "0 */12 * * *"
workflow_dispatch:

jobs:
labeler:
name: Labeler
runs-on: ubuntu-latest
steps:
- name: Labeler
uses: open-education-hub/actions/cron-labeler@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Vim swap files
*.swp
*.swo

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# reveal-md slides output folder
_site/

# Builder output folder
/.output/
118 changes: 118 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Contributing to Hardware Software Interface OER

These are recommendations when contributing to the contents of the Hardware Software Interface OER repository.
They consider contributions to both actual content (mostly Markdown) and support code made via Git.

## First Steps

Some good first steps and best practices when using Git are explained here:

- the Git Immersion tutorial: <https://gitimmersion.com/>
- the Atlassian tutorial: <https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud>
- this blog post on the `ROSEdu Techblog`: <https://techblog.rosedu.org/git-good-practices.html>

## Language

All of our content is developed in English.
This means we use English for content, support code, commit messages, pull requests, issues, comments, everything.

## Content Writing Style

This section addresses the development of session content and other Markdown files.

Write each sentence on a new line.
This way, changing one sentence only affects one line in the source code.

Use the **first person plural** when writing documentation and tutorials.
Use phrases like "we run the command / app", "we look at the source code", "we find the flag".

Use the second person for challenges and other individual activities.
Use phrases like "find the flag", "run this command", "download the tool".

## Images

Use [draw.io](https://app.diagrams.net/) to create diagrams.
If using external images / diagram, make sure they use a CC BY-SA license and give credits (mention author and / or add link to the image source).

## Slides

Slides are to be written in Markdown, using [`reveal-md`](https://github.com/webpro/reveal-md), itself based on [`reveal-js`](https://revealjs.com/).
Use `reveal-md` and `reveal-js` specifics to split information in slides.
Aim to make slides attractive, sleek and simple to follow.

Images and diagrams would ideally be animated on slides.
Aim to use `reveal.js` features to animate drawing of diagrams.

If `reveal.js` drawig is difficult, use [draw.io](https://app.diagrams.net/) to create diagrams.
Ideally you would "animate" those diagrams by creating multiple incremental versions of the diagram and adding each to a slide;
when browsing slides pieces of these diagrams will "appear" and complete the final image, rendering an animation-like effect.

## Issues

When opening an issue, please clearly state the problem.
Make sure it's reproducible.
Add images if required.
Also, if relevant, detail the environment you used (OS, software versions).
Ideally, if the issue is something you could fix, open a pull request with the fix.

## Discussions

Use GitHub discussions for bringing up ideas on content, new chapters, new sections.
Provide support to others asking questions and take part in suggestions brought by others.
Please be civil when taking part in discussions.

## Pull Requests

For pull requests, please follow the [GitHub flow](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork): create a fork of the repository, create your own branch, do commits, push changes to your branch, do a pull request (PR).
The destination branch of pull requests is the default `master` branch.

Make sure each commit corresponds to **one** code / content change only.
If there are multiple commits belonging to a given change, please squash the commits.

Also make sure one pull request covers only **one** topic.

### Commits

Before making a commit, configure your name and email locally using:

```bash
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
```

Then make sure the email you've just configured corresponds to the one you have [set on GitHub](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/adding-an-email-address-to-your-github-account).

After this, make your changes, `git add` them and then commit them using `git commit -s`.
Always sign your commits using the `-s` / `--signoff` arguments to `git commit`.
This will add the following line at the end of the commit message:

```text
Signed-off-by: Your Name <[email protected]>
```

Notice that the details above are the name and email that you configured earlier.

Now the `git commit` command will open your default editor and ask you to write a commit message.
Prefix each commit message name with the chapter and content type it belongs to, e.g. `TODO-chapter/reading`, `TODO-chapter/slides`, `TODO-chapter/drills`.
Following the prefix, write a short and expressive title on the first line.
Use commit messages with verbs at imperative mood: "Add README", "Update contents", "Introduce feature".

Leave an empty line, then add a relevant description of the changes made in that commit.
This description should include why that change is needed (fixes a bug, improves something that was inefficient, etc.).
Wrap the lines of this description to 75 characters.
How a good commit message should look like: <https://cbea.ms/git-commit/>
Below is an example of a good commit message:

```text
template-chapter/drills: Fix Makefile `CFLAGS` error
`CFLAGS` was incorrectly set to optimise the code to the `-O3` level. This
caused the function `vulnerable_func()` to be inlined into the caller
`main()`, making it impossible to overwrite `main()`'s return address with
that of `vulnerable_func()`. This commit fixes the issue by forcing the
compiler to not optimise the code by replacing `-O3` with `-O0` in `CFLAGS`
Signed-off-by: Your Name <[email protected]>
```

The use of `-s` / `--signoff` when creating a commit is optional, but strongly recommended.
Loading

0 comments on commit bad1a7f

Please sign in to comment.