Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opinions & linting #6948

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Bug report
description: Create a report to help us improve
title: "[Issue Report]: "
Expand Down Expand Up @@ -69,3 +70,4 @@ body:
attributes:
label: Additional context
placeholder: Any other context about the problem here (screenshots, videos, code blocks, etc.).
...
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Feature Request
description: Request a feature or improvement.
title: "[Feature Request]: "
Expand All @@ -21,3 +22,4 @@ body:
placeholder: A clear and concise description of the desired feature/change.
validations:
required: true
...
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
...
82 changes: 44 additions & 38 deletions .github/workflows/Android.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
name: Android

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -21,39 +23,43 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install gettext
run: sudo apt-get update && sudo apt-get install -y gettext

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Cache CMake build folder
uses: actions/cache@v4
with:
path: android-project/app/.cxx
key: ${{ github.workflow }}-v4-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v4-

- name: Build
working-directory: ${{github.workspace}}
shell: bash
run: cd android-project && ./gradlew assembleDebug

- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: devilutionx-debug.apk
path: android-project/app/build/outputs/apk/debug/app-debug.apk

- name: Clean up artifacts
run: rm -rf android-project/app/build/outputs
- name: Install gettext
run: |
apt-get update
apt-get install -y \
gettext

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Cache CMake build folder
uses: actions/cache@v4
with:
path: android-project/app/.cxx
key: ${{ github.workflow }}-v4-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v4-

- name: Build
working-directory: ${{github.workspace}}
shell: bash
run: cd android-project && ./gradlew assembleDebug

- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: devilutionx-debug.apk
path: android-project/app/build/outputs/apk/debug/app-debug.apk

- name: Clean up artifacts
run: rm -rf android-project/app/build/outputs
...
159 changes: 82 additions & 77 deletions .github/workflows/Linux_aarch64.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Linux AArch64 (aarch64-linux-gnu)

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand All @@ -14,9 +15,6 @@ on:
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:

concurrency:
Expand All @@ -27,88 +25,95 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# Work around the somewhat broken packages in the GitHub Actions Ubuntu 20.04 image.
# https://github.com/actions/runner-images/issues/4620#issuecomment-981333260
- name: Work around broken packages
run: sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7
# Work around the somewhat broken packages in the GitHub Actions Ubuntu 20.04 image.
# https://github.com/actions/runner-images/issues/4620#issuecomment-981333260
- name: Work around broken packages
run: sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7

- name: Add clang repo
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo tee /etc/apt/sources.list.d/clang.list <<LIST
deb [arch=amd64,arm64] http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
LIST
- name: Add clang repo
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo tee /etc/apt/sources.list.d/clang.list <<LIST
deb [arch=amd64,arm64] http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
LIST

# Installs dependencies, including arm64 libraries (runs `sudo apt-get update` as part of it)
- name: Install dependencies
run: Packaging/nix/debian-cross-aarch64-prep.sh --no-gcc
# Installs dependencies, including arm64 libraries (runs `sudo apt-get update` as part of it)
- name: Install dependencies
run: Packaging/nix/debian-cross-aarch64-prep.sh --no-gcc

- name: Install clang-18
run: |
sudo apt-get install -yq --no-install-recommends clang-18 lld-18 libc++-18-dev:arm64 \
libgcc-10-dev-arm64-cross binutils-aarch64-linux-gnu libc++1-18:arm64 libc++abi1-18:arm64 && \
sudo update-alternatives --install \
/usr/bin/clang++ clang++ /usr/bin/clang++-18 200 && \
sudo update-alternatives --install \
/usr/bin/clang clang /usr/bin/clang-18 200 \
--slave /usr/bin/lld lld /usr/bin/lld-18 \
--slave /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-18
- name: Install clang-18
run: |
sudo apt-get install -yq --no-install-recommends clang-18 lld-18 libc++-18-dev:arm64 \
libgcc-10-dev-arm64-cross binutils-aarch64-linux-gnu libc++1-18:arm64 libc++abi1-18:arm64 && \
sudo update-alternatives --install \
/usr/bin/clang++ clang++ /usr/bin/clang++-18 200 && \
sudo update-alternatives --install \
/usr/bin/clang clang /usr/bin/clang-18 200 \
--slave /usr/bin/lld lld /usr/bin/lld-18 \
--slave /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-18

- name: Cache CMake build folder
uses: actions/cache@v4
with:
path: build
key: ${{ github.workflow }}-v6-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v6-
- name: Cache CMake build folder
uses: actions/cache@v4
with:
path: build
key: ${{ github.workflow }}-v6-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v6-

- name: Build
working-directory: ${{github.workspace}}
shell: bash
env:
CMAKE_BUILD_TYPE: ${{github.event_name == 'release' && 'Release' || 'RelWithDebInfo'}}
# We set DEVILUTIONX_SYSTEM_LIBFMT=OFF because its soversion changes frequently.
# We set DEVILUTIONX_SYSTEM_SIMPLEINI=OFF because we require v4.19+, still missing from many distributions.
run: |
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/aarch64-linux-gnu-clang-static-libc++.toolchain.cmake \
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DCPACK=ON \
-DDEVILUTIONX_SYSTEM_LIBFMT=OFF -DDEVILUTIONX_SYSTEM_SIMPLEINI=OFF && \
cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target package
- name: Build
working-directory: ${{github.workspace}}
shell: bash
env:
CMAKE_BUILD_TYPE: ${{github.event_name == 'release' && 'Release' || 'RelWithDebInfo'}}
# We set DEVILUTIONX_SYSTEM_LIBFMT=OFF because its soversion changes frequently.
# We set DEVILUTIONX_SYSTEM_SIMPLEINI=OFF because we require v4.19+, still missing from many distributions.
run: |
cmake \
-S . \
-B build \
-D CMAKE_TOOLCHAIN_FILE=../CMake/platforms/aarch64-linux-gnu-clang-static-libc++.toolchain.cmake \
-D CMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CPACK=ON \
-D DEVILUTIONX_SYSTEM_LIBFMT=OFF \
-D DEVILUTIONX_SYSTEM_SIMPLEINI=OFF
cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target package

- name: Package
run: Packaging/nix/LinuxReleasePackaging.sh && mv devilutionx.tar.xz devilutionx-aarch64-linux-gnu.tar.xz
- name: Package
run: Packaging/nix/LinuxReleasePackaging.sh && mv devilutionx.tar.xz devilutionx-aarch64-linux-gnu.tar.xz

# AppImage cross-packaging is not implemented yet.
# - name: Package AppImage
# run: Packaging/nix/AppImage.sh && mv devilutionx.appimage devilutionx-aarch64-linux-gnu.appimage
# AppImage cross-packaging is not implemented yet.
# - name: Package AppImage
# run: Packaging/nix/AppImage.sh && mv devilutionx.appimage devilutionx-aarch64-linux-gnu.appimage

- name: Upload Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: devilutionx-aarch64-linux-gnu.tar.xz
path: devilutionx-aarch64-linux-gnu.tar.xz
- name: Upload Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: devilutionx-aarch64-linux-gnu.tar.xz
path: devilutionx-aarch64-linux-gnu.tar.xz

# AppImage cross-packaging is not implemented yet.
# - name: Upload AppImage
# if: ${{ !env.ACT }}
# uses: actions/upload-artifact@v4
# with:
# name: devilutionx-aarch64-linux-gnu.appimage
# path: devilutionx-aarch64-linux-gnu.appimage
# AppImage cross-packaging is not implemented yet.
# - name: Upload AppImage
# if: ${{ !env.ACT }}
# uses: actions/upload-artifact@v4
# with:
# name: devilutionx-aarch64-linux-gnu.appimage
# path: devilutionx-aarch64-linux-gnu.appimage

- name: Update Release
if: ${{ github.event_name == 'release' && !env.ACT }}
uses: svenstaro/upload-release-action@v2
with:
file: devilutionx-aarch64-linux-gnu.*
file_glob: true
overwrite: true
- name: Update Release
if: ${{ github.event_name == 'release' && !env.ACT }}
uses: svenstaro/upload-release-action@v2
with:
file: devilutionx-aarch64-linux-gnu.*
file_glob: true
overwrite: true

- name: Clean up artifacts
run: rm -rf build/_CPack_Packages build/package build/*.deb build/*.rpm build/*.appimage build/*.tar.xz
- name: Clean up artifacts
run: rm -rf build/_CPack_Packages build/package build/*.deb build/*.rpm build/*.appimage build/*.tar.xz
...