Skip to content

Commit

Permalink
Merge branch 'testing' into Eeems-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems authored Dec 7, 2024
2 parents c02ce0a + 3d9fb76 commit 16ba28f
Show file tree
Hide file tree
Showing 142 changed files with 5,674 additions and 3,215 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Documentation Issue
about: Report an issue with the documentation
title: ''
labels: bug, documentation
assignees: ''

---

**Describe the issue**
A clear and concise description of what the issue with the documentation is.

**Potential resolution**
A clear and concise description of what you expected to happen.

**Links**
If applicable, add links to the documentation in question.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Documentation request
about: Request changes to the documentation
title: ''
labels: documentation
assignees: ''

---

**Is your documentation request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/installation-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Installation issue
about: Report an issue with the installation process
title: ''
labels: bug, install
assignees: ''

---

**Describe the issue**
A clear and concise description of what the issue is.

**To Reproduce**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Device information (please complete the following information):**
- Device: [e.g. reMarkable 2]
- OS version: [e.g. 2.15]

**Additional context**
Add any other context about the problem here.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/package-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Package Issue
about: Create a report to help us improve
title: ''
labels: bug, packages
assignees: ''

---

**Describe the issue**
A clear and concise description of what the issue is.

**To Reproduce**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Upstream issue**
If applicable, add the link to the upstream issue here.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Device/Package information (please complete the following information):**
- Device: [e.g. reMarkable 2]
- OS version: [e.g. 2.15]
- Package: [e.g. toltec-base 0.0.1-1]

**Additional context**
Add any other context about the problem here.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/package-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Package request
about: Request a package be added to toltec
title: Add [package] to toltec
labels: packages
assignees: ''

---

**Package information**
Add the name of the package, and a link to where the source can be found.

**Reason for addition**
Provide some basic information about why you'd need this package, and what it provides that existing packages don't.
19 changes: 11 additions & 8 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
sudo apt-get update -yq
echo "aptVersion=libarchive-tools-$(apt-cache policy libarchive-tools | grep -oP '(?<=Candidate:\s)(.+)')" >> $GITHUB_ENV
- name: Cache Apt packages
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-apt
with:
path: ~/.aptcache
Expand All @@ -26,7 +26,7 @@ runs:
sudo cp --verbose --force --recursive ~/.aptcache/* /
fi
- name: Cache shfmt
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /usr/local/bin/shfmt
key: 43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
Expand All @@ -44,7 +44,7 @@ runs:
sudo chmod a+x "$install_dir"/shfmt
fi
- name: Cache Shellcheck
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /usr/local/bin/shellcheck
key: 64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
Expand All @@ -67,18 +67,21 @@ runs:
sudo chown root:root shellcheck
sudo mv shellcheck "$install_dir"
fi
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Cache Python environment
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-python
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
path: .venv
key: .venv-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
shell: bash
env:
CACHE_HIT: ${{ steps.cache-python.outputs.cache-hit }}
run: |
if [[ "$CACHE_HIT" != 'true' ]]; then
python -m pip install --upgrade pip
pip install -r requirements.txt
make .venv/bin/activate
fi
2 changes: 1 addition & 1 deletion .github/actions/sync-repository/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
echo '${{ inputs.ssh-key }}' > private/id_rsa
echo '${{ inputs.ssh-known-hosts }}' > private/known_hosts
chmod 600 private/*
rsync --archive --verbose --compress --delete \
rsync --archive --verbose --compress --delete --hard-links \
-e "ssh -p ${{ inputs.ssh-port }} -i private/id_rsa -o UserKnownHostsFile=private/known_hosts" \
'${{ inputs.local-path }}' \
'${{ inputs.remote-path }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
check-labels:
name: Check that PRs against the stable branch are labelled correctly
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check labels
run: |
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ on:
jobs:
lint:
name: Check that it conforms to the style guide
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout the Git repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
uses: actions/checkout@v4
- name: Setup Toltec dependencies
uses: ./.github/actions/setup
- name: Check formatting
Expand All @@ -20,21 +16,29 @@ jobs:
run: make lint
pr:
name: Check that it builds without error
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: lint
steps:
- name: Checkout the Git repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
uses: actions/checkout@v4
- name: Setup Toltec dependencies
uses: ./.github/actions/setup
- name: Build packages
run: make repo-new FLAGS='--remote-repo https://toltec-dev.org/${{ github.base_ref }}'
run: FLAGS='--remote-repo https://toltec-dev.org/${{ github.base_ref }}' make repo-new
- name: Save the build output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: repo
path: build/repo
- name: Build packages for experimental
if: ${{ contains(github.event.pull_request.labels.*.name, 'experimental') }}
run: make repo FLAGS='--remote-repo https://toltec-dev.org/${{ github.base_ref }}'
- name: Sync packages with the remote repository
if: ${{ contains(github.event.pull_request.labels.*.name, 'experimental') }}
uses: ./.github/actions/sync-repository
with:
local-path: build/repo/
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
ssh-port: ${{ secrets.SSH_PORT }}
remote-path: ${{ secrets.REMOTE_SSH }}:/srv/toltec/experimental
14 changes: 7 additions & 7 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ on:
jobs:
stable:
name: Build and publish the stable channel
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout the Git repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
uses: actions/checkout@v4
- name: Setup Toltec dependencies
uses: ./.github/actions/setup
- name: Build packages
Expand All @@ -33,9 +29,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Create Github Release
continue-on-error: true
run: hub release create -t ${{ github.sha }} -m "${{ github.event.commits[0].message }}" $(date +%G-W%V-%u)
run: |
sudo apt-get update && sudo apt-get install -y hub
hub release create -t $SHA -m $MESSAGE $(date +%G-W%V-%u)
env:
SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
MESSAGE: ${{ github.event.commits[0].message }}
- name: Send notification to Discord
continue-on-error: true
uses: ./.github/actions/discord-send
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ on:
jobs:
testing:
name: Build and publish the testing channel
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout the Git repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
uses: actions/checkout@v4
- name: Setup Toltec dependencies
uses: ./.github/actions/setup
- name: Build packages
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
private
build
build/
!scripts/build/
__pycache__
.venv
.venv/
repo/
37 changes: 28 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ RECIPES=$(shell ls package/)
RECIPES_PUSH=$(foreach app, $(RECIPES), $(app)-push)
RECIPES_CLEAN=$(foreach app, $(RECIPES), $(app)-clean)

ifeq ($(RUNNER_DEBUG), 1)
FLAGS+= --verbose
endif

define USAGE
Building packages:

Expand Down Expand Up @@ -44,19 +48,30 @@ export USAGE
help:
@echo "$$USAGE"

repo:
.venv/bin/activate: requirements.txt
@echo "Setting up development virtual env in .venv"
python -m venv .venv; \
. .venv/bin/activate; \
python -m pip install -r requirements.txt

repo: .venv/bin/activate
. .venv/bin/activate; \
./scripts/repo_build.py $(FLAGS)

repo-local:
repo-local: .venv/bin/activate
. .venv/bin/activate; \
./scripts/repo_build.py --local $(FLAGS)

repo-new:
repo-new: .venv/bin/activate
. .venv/bin/activate; \
./scripts/repo_build.py --diff $(FLAGS)

repo-check:
repo-check: .venv/bin/activate
. .venv/bin/activate; \
./scripts/repo-check build/repo

$(RECIPES): %:
$(RECIPES): %: .venv/bin/activate
. .venv/bin/activate; \
./scripts/package_build.py $(FLAGS) "$(@)"

push: %:
Expand All @@ -81,24 +96,28 @@ $(RECIPES_PUSH): %:
"Make sure rsync is installed on your reMarkable."; \
fi

format:
format: .venv/bin/activate
@echo "==> Checking Bash formatting"
shfmt -d .
@echo "==> Checking Python formatting"
. .venv/bin/activate; \
black --line-length 80 --check --diff scripts

format-fix:
format-fix: .venv/bin/activate
@echo "==> Fixing Bash formatting"
shfmt -l -w .
@echo "==> Fixing Python formatting"
. .venv/bin/activate; \
black --line-length 80 scripts

lint:
lint: .venv/bin/activate
@echo "==> Linting Bash scripts"
shellcheck $$(shfmt -f .) -P SCRIPTDIR
# shellcheck $$(shfmt -f .) -P SCRIPTDIR
@echo "==> Typechecking Python files"
. .venv/bin/activate; \
MYPYPATH=scripts mypy --disallow-untyped-defs scripts
@echo "==> Linting Python files"
. .venv/bin/activate; \
PYTHONPATH=: pylint scripts

$(RECIPES_CLEAN): %:
Expand Down
Loading

0 comments on commit 16ba28f

Please sign in to comment.