Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .github/scripts/check-contrib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
set -eu

bash --version
zsh --version

find contrib -type f \( -name '*.sh' -o -name '*.bash' \) -exec bash --norc -n {} \;
find contrib/zsh_compl -type f -name '_rgb*' -exec zsh -n {} \;
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/scripts/draft-release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail

tag=$1
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions .github/workflows/check-contrib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Contrib script syntax checking
on:
- push
- pull_request

env:
# Force colored output (see https://bixense.com/clicolors/ and https://force-color.org/)
TERM: xterm-256color
CLICOLOR: 1
CLICOLOR_FORCE: 1

jobs:
check-contrib:
runs-on: ubuntu-slim
steps:
- name: Checkout repo
uses: actions/checkout@v7
- name: Install zsh
run: |
sudo apt install -Uyq zsh
- name: Check contrib scripts
run: |
.github/scripts/check-contrib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
CLICOLOR_FORCE: 1

jobs:
checkdiff:
check-diff:
runs-on: ubuntu-slim
steps:
- name: Clone repo
Expand All @@ -20,7 +20,7 @@ jobs:
run: |
MERGE_BASE=$(gh api "/repos/{owner}/{repo}/compare/$BASE_SHA...$HEAD_SHA" --jq '.merge_base_commit.sha')
git fetch origin "$MERGE_BASE"
contrib/checkdiff.bash "$MERGE_BASE" | sed -E 's/^/::warning::/'
.github/scripts/check-diff.bash "$MERGE_BASE" | sed -E 's/^/::warning::/'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
CLICOLOR_FORCE: 1

jobs:
checkformat:
check-format:
runs-on: ubuntu-slim
steps:
- name: Checkout repo
Expand All @@ -18,4 +18,4 @@ jobs:
sudo apt install -Uyq clang-format
- name: Check format
run: |
contrib/checkformat.sh
.github/scripts/check-format.sh
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
.github/scripts/install_deps.sh ubuntu-latest lcov
.github/scripts/install-deps.sh ubuntu-latest lcov
- name: Generate coverage report
run: |
contrib/coverage.bash --os ubuntu-latest --jobs "$(getconf _NPROCESSORS_ONLN)"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
bash .github/scripts/install_deps.sh windows
bash .github/scripts/install-deps.sh windows
- name: Build Windows binaries
shell: cmd
run: |
Expand All @@ -58,7 +58,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
./.github/scripts/install_deps.sh macos lld
./.github/scripts/install-deps.sh macos lld
- name: Build binaries
run: |
cmake -B build -G Ninja --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
./.github/scripts/install_deps.sh ubuntu-22.04
./.github/scripts/install-deps.sh ubuntu-22.04
- name: Build binaries
run: |
make -k -j "$(getconf _NPROCESSORS_ONLN)" WARNFLAGS="-Wall -Wextra -pedantic -static" PKG_CONFIG="pkg-config --static" Q=
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
.github/scripts/install_deps.sh ${{ matrix.os }} ${{ matrix.cxx }}
.github/scripts/install-deps.sh ${{ matrix.os }} ${{ matrix.cxx }}
- name: Build using Make
if: matrix.buildsys == 'make'
run: |
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
.github/scripts/install_deps.sh macos lld
.github/scripts/install-deps.sh macos lld
- name: Cache library deps
uses: actions/cache@v5
with:
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
bash .github/scripts/install_deps.sh ${{ matrix.os }}
bash .github/scripts/install-deps.sh ${{ matrix.os }}
- name: Cache library deps
uses: actions/cache@v5
with:
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
uses: actions/checkout@v7
- name: Install deps
run: |
.github/scripts/install_deps.sh ubuntu mingw${{ matrix.bits }}
.github/scripts/install-deps.sh ubuntu mingw${{ matrix.bits }}
- name: Cache library deps
uses: actions/cache@v5
with:
Expand Down Expand Up @@ -292,7 +292,7 @@ jobs:
uses: actions/checkout@v7
- name: Install test deps
run: |
.github/scripts/install_deps.sh windowsmingw
.github/scripts/install-deps.sh windowsmingw
- name: Retrieve binaries
uses: actions/download-artifact@v8
with:
Expand Down Expand Up @@ -396,7 +396,7 @@ jobs:
release: "14.3"
usesh: true
prepare: |
.github/scripts/install_deps.sh freebsd
.github/scripts/install-deps.sh freebsd
run: | # Leak detection is not supported on FreeBSD, so disable it.
cmake -B build --preset develop
cmake --build build --verbose -- -k -j "$(getconf _NPROCESSORS_ONLN)"
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ WORKDIR /rgbds

COPY . .

# Install dependencies
RUN apt-get update && \
apt-get install sudo make cmake gcc build-essential -y
RUN ./.github/scripts/install-deps.sh debian

# Install dependencies and compile RGBDS
RUN ./.github/scripts/install_deps.sh debian
# Build RGBDS
RUN make -j "$(getconf _NPROCESSORS_ONLN)" CXXFLAGS="-O3 -flto -DNDEBUG -static" PKG_CONFIG="pkg-config --static" Q=

# Create the install script
Expand Down
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.SUFFIXES:
.SUFFIXES: .cpp .y .o

.PHONY: all clean install checkdiff develop debug profile coverage format tidy iwyu wine-shim dist
.PHONY: all clean install develop debug profile coverage format tidy iwyu wine-shim dist

# User-defined variables

Expand Down Expand Up @@ -44,9 +44,6 @@ BISON := src/bison.sh

RM := rm -rf

# Used for checking pull requests
BASE_REF := origin/master

# Rules to build the RGBDS binaries

all: rgbasm rgblink rgbfix rgbgfx
Expand Down Expand Up @@ -214,10 +211,6 @@ install: all
$Qinstall -m ${MANMODE} ${MANSRC}rgbds.5 ${MANSRC}rgbasm.5 ${MANSRC}rgbasm-old.5 ${MANSRC}rgblink.5 ${DESTDIR}${mandir}/man5/
$Qinstall -m ${MANMODE} ${MANSRC}rgbds.7 ${MANSRC}gbz80.7 ${DESTDIR}${mandir}/man7/

# Target used to check for suspiciously missing changed files.
checkdiff:
$Qcontrib/checkdiff.bash `git merge-base HEAD ${BASE_REF}`

# Target used in development to prevent adding new issues to the source code.
# All warnings are treated as errors to block the compilation and make the
# continous integration infrastructure return failure.
Expand Down
2 changes: 1 addition & 1 deletion contrib/coverage.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -eu

usage() {
cat <<"EOF"
Expand Down
2 changes: 1 addition & 1 deletion contrib/view_palettes.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail

if [[ $# -ne 2 ]]; then
Expand Down
Loading