Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github/** -linguist-vendored -linguist-generated -linguist-documentation linguist-detectable
.vscode/** -linguist-vendored -linguist-generated -linguist-documentation linguist-detectable

*.json linguist-detectable

.gitignore -linguist-vendored -linguist-generated -linguist-documentation linguist-detectable
LICENSE -linguist-vendored -linguist-generated -linguist-documentation linguist-detectable
README.md -linguist-vendored -linguist-generated -linguist-documentation linguist-detectable

main.m -linguist-detectable
src/** -linguist-detectable
27 changes: 27 additions & 0 deletions .github/actions/patch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'matlab-repo-patch'
description: 'Pull latest release of `matlab-repo-init`'
runs:
using: "composite"
steps:
- run: |
git remote add matlab-repo-init https://github.com/djmaxus/matlab-repo-init.git --fetch --no-tags

release_sha=$(git ls-remote --tags matlab-repo-init | tail -1 | cut -f1)
release_ref=$(git ls-remote --tags matlab-repo-init | tail -1 | cut -f2)

# compile and apply patch
git diff --binary "$(git hash-object -t tree /dev/null)" "$release_sha" > matlab-repo-init.patch
git apply --theirs --3way matlab-repo-init.patch

git add .

git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

git commit -m "WIP: matlab-repo-init:$release_ref"

git --no-pager log --decorate=short --pretty=oneline -n1

git checkout -b matlab-repo-init
git push -u origin matlab-repo-init
shell: bash
54 changes: 54 additions & 0 deletions .github/rules/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "main",
"target": "branch",
"source_type": "Repository",
"source": "djmaxus/matlab-repo-init",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [],
"include": [
"~DEFAULT_BRANCH",
"refs/heads/main"
]
}
},
"rules": [
{
"type": "deletion"
},
{
"type": "non_fast_forward"
},
{
"type": "creation"
},
{
"type": "update"
},
{
"type": "required_linear_history"
},
{
"type": "pull_request",
"parameters": {
"required_approving_review_count": 1,
"dismiss_stale_reviews_on_push": true,
"require_code_owner_review": true,
"require_last_push_approval": true,
"required_review_thread_resolution": true,
"automatic_copilot_code_review_enabled": false,
"allowed_merge_methods": [
"rebase"
]
}
}
],
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "pull_request"
}
]
}
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
lints: # fast lints
name: Lints
uses: ./.github/workflows/lints.yml
matlab: # heavy MATLAB checks
needs: lints
uses: ./.github/workflows/matlab.yml
17 changes: 17 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
schedule:
- cron: 0 0 * * 1 # midnight every Monday
workflow_dispatch:
workflow_call:

jobs:
check-links:
name: Linkspector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run linkspector
uses: umbrelladocs/action-linkspector@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
30 changes: 30 additions & 0 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
workflow_call:
jobs:
links:
uses: ./.github/workflows/links.yml
commit:
name: Commit messages
runs-on: ubuntu-latest
steps:
- uses: opensource-nepal/commitlint@v1
markdown:
name: Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v19
with:
fix: true
globs: |
**/*.md
!CHANGELOG.md
cspell:
name: Spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v6
with:
files: "**/*.md"
config: cspell.json
15 changes: 15 additions & 0 deletions .github/workflows/matlab-repo-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: matlab-repo-patch

on:
workflow_dispatch:


permissions:
contents: write

jobs:
matlab-repo-patch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: djmaxus/matlab-repo-init/.github/actions/patch@v0.8.0
18 changes: 18 additions & 0 deletions .github/workflows/matlab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
workflow_call:
workflow_dispatch:

jobs:
buildtool:
strategy:
matrix:
release: [R2023b, R2024b]
name: MATLAB checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.release }}
cache: true
- uses: matlab-actions/run-build@v2
6 changes: 2 additions & 4 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Release automation

on:
push:
branches:
Expand All @@ -8,16 +10,12 @@ permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:

token: ${{ secrets.GITHUB_TOKEN }}

release-type: simple
target-branch: main
24 changes: 24 additions & 0 deletions .github/workflows/sync-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches: [main]
workflow_dispatch:

jobs:
mirror_repo:
if: github.repository == 'djmaxus/matlab-repo-init'
runs-on: ubuntu-latest
steps:
- uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.MATLAB_TEMPLATE_MIRROR_SSH_PRIVATE_KEY }}
- name: Push changes to ImperialCollegeLondon/matlab-repo-init
run: |
# Clone and check out this repo
git clone --mirror git@github.com:djmaxus/matlab-repo-init.git
cd matlab-repo-init.git

# Add repo in Imperial's org as remote
git remote add icl git@github.com:ImperialCollegeLondon/matlab-repo-init.git

# Push all branches, overwriting if necessary
git push --force --tags icl main
44 changes: 21 additions & 23 deletions .github/workflows/webpage.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: StrataTrapper webpage
name: Repository webpage

on:
# Runs on pushes targeting the default branch
push:
release:
types: [released]
pull_request:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
vendor/bundle
.jekyll-cache
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- uses: actions/configure-pages@v5
- uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
if: ${{ github.event_name != 'pull_request' }}
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
- id: deployment
uses: actions/deploy-pages@v4
Loading
Loading