Add forgejo actions
This covers just the "main" target but proves that everything could work in the case of an orderly departure from github.
This commit is contained in:
parent
75558756c7
commit
bcbc8719a3
4 changed files with 104 additions and 12 deletions
96
.forgejo/workflows/ci.yml
Normal file
96
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
name: m68k macintosh port
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
release:
|
||||
types:
|
||||
- created # forgejo does not document the value "created"
|
||||
- published
|
||||
|
||||
# (may not be used by forgejo, but is ignored for now)
|
||||
concurrency:
|
||||
group: ${{ forge.workflow }}-${{ forge.ref_name }}-${{ forge.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions: write-all
|
||||
runs-on: codeberg-tiny
|
||||
container:
|
||||
image: ghcr.io/m68k-micropython/retro68@sha256:fb78281a61f1324a3d552f1a8bbf8b35690926f0b11da2dacddd985f4ff4acac
|
||||
steps:
|
||||
- name: Set up tea
|
||||
run: |
|
||||
set -x
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
curl -sL https://dl.gitea.io/tea/"$TEA_VERSION"/tea-"$TEA_VERSION"-linux-"$ARCH" > /usr/local/bin/tea
|
||||
chmod +x /usr/local/bin/tea
|
||||
tea --version
|
||||
env:
|
||||
TEA_VERSION: "0.10.1"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# These get confused by some submodules, oof
|
||||
- name: Install packages for C code formatting
|
||||
run: pip install --break-system-packages micropython-uncrustify
|
||||
- name: Run C code formatting
|
||||
run: source tools/ci.sh && ci_c_code_formatting_run
|
||||
- name: Check code formatting
|
||||
run: git diff --exit-code
|
||||
|
||||
- name: Check spelling
|
||||
run: |
|
||||
pip install --break-system-packages codespell==2.4.1 tomli
|
||||
codespell
|
||||
|
||||
- name: Run ruff
|
||||
run: |
|
||||
pip install --break-system-packages ruff==0.11.6
|
||||
ruff check --output-format=github .
|
||||
ruff format --diff .
|
||||
|
||||
|
||||
- name: Build m68k port
|
||||
run: |
|
||||
git config --global --add safe.directory $(pwd)
|
||||
make -C mpy-cross -j$(nproc)
|
||||
make -C ports/m68kmac submodules
|
||||
make -C ports/m68kmac -j$(nproc) MICROPY_USE_COMPILER_PLUGIN=gcc
|
||||
|
||||
- name: Prepare release distribution
|
||||
run: |
|
||||
mkdir dist/
|
||||
cp ports/m68kmac/build/micropython.{bin,dsk} dist/
|
||||
|
||||
- name: Attach files to actions run
|
||||
if: ${{ forge.event_name != 'release' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: dist/*
|
||||
|
||||
- name: Run tests via "unix" port
|
||||
run: |
|
||||
make -C ports/unix submodules
|
||||
make -C ports/unix -j$(nproc)
|
||||
ulimit -n 1024; \
|
||||
cd tests; \
|
||||
if ! ./run-tests.py -e "cmdline/repl_" -e "asyncio_fair" -e "asyncio_heaplock"; then \
|
||||
./run-tests.py --print-failures; \
|
||||
exit 1;\
|
||||
fi
|
||||
|
||||
- name: Check build directory size
|
||||
run: du -shx
|
||||
|
||||
- name: Attach files to release
|
||||
if: ${{ forge.event_name == 'release' }}
|
||||
run: |
|
||||
tools/add_release_assets.sh
|
||||
env:
|
||||
TEA_VERSION: "0.10.1"
|
||||
EVENT_DATA: ${{ forge.event_path }}
|
||||
GITEA_SERVER_TOKEN: ${{ forge.token }}
|
||||
FORGE_SERVER_URL: ${{ forge.server_url }}
|
||||
TAG: ${{ forge.event.release.name }}
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -24,3 +24,6 @@ user.props
|
|||
|
||||
# MacOS desktop metadata files
|
||||
.DS_Store
|
||||
|
||||
# Created during the distribution making process
|
||||
/dist
|
||||
|
|
|
|||
|
|
@ -20,18 +20,6 @@ MICROPY_PY_TERMIOS = 1
|
|||
# Subset of CPython socket module
|
||||
MICROPY_PY_SOCKET = 1
|
||||
|
||||
# ffi module requires libffi (libffi-dev Debian package)
|
||||
MICROPY_PY_FFI = 1
|
||||
|
||||
# ssl module requires one of the TLS libraries below
|
||||
MICROPY_PY_SSL = 1
|
||||
# axTLS has minimal size but implements only a subset of modern TLS
|
||||
# functionality, so may have problems with some servers.
|
||||
MICROPY_SSL_AXTLS = 0
|
||||
# mbedTLS is more up to date and complete implementation, but also
|
||||
# more bloated.
|
||||
MICROPY_SSL_MBEDTLS = 1
|
||||
|
||||
# jni module requires JVM/JNI
|
||||
MICROPY_PY_JNI = 0
|
||||
|
||||
|
|
|
|||
5
tools/add_release_assets.sh
Executable file
5
tools/add_release_assets.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
tea login add --url "$FORGE_SERVER_URL"
|
||||
|
||||
tea release asset create "${TAG}" dist/*
|
||||
Loading…
Reference in a new issue