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

Add shellcheck test action #108

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
102 changes: 102 additions & 0 deletions .github/workflows/build_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI

on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
workflow_dispatch:

jobs:
ShellCheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ShellCheck Depends
uses: ludeeus/action-shellcheck@master
Docker:
name: Docker
runs-on: ubuntu-latest
needs: ShellCheck
steps:
- name: Make Space
run: |
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
- name: Checkout
if: success()
id: checkout
uses: actions/checkout@v2
- name: Set up QEMU
if: success()
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
if: success()
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platforms::linux/amd64,linux/386
VERSION_TAG=${GITHUB_REF#refs/*/}
echo ::set-output name=version::${VERSION_TAG%/merge}
# - name: Login to DockerHub
# if: success()
# id: login_docker
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
if: success()
id: login_github
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push (master)
if: success() && steps.prepare.outputs.version == 'master' && github.event_name != 'pull_request'
id: build_push_master
uses: docker/build-push-action@v2
with:
context: .
platforms: ${{ steps.prepare.outputs.docker_platforms }}
push: true
tags: |
ghcr.io/ps3dev/ps3dev:master
ghcr.io/ps3dev/ps3dev:latest
# ps3dev/ps3dev:master
# ps3dev/ps3dev:latest
- name: Build and push (development)
if: success() && steps.prepare.outputs.version != 'master'
id: build_push_development
uses: docker/build-push-action@v2
with:
context: .
platforms: ${{ steps.prepare.outputs.docker_platforms }}
push: true
tags: |
ghcr.io/ps3dev/ps3dev:${{ steps.prepare.outputs.version }}
# ps3dev/ps3dev:${{ steps.prepare.outputs.version }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
if: success()
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
19 changes: 19 additions & 0 deletions .github/workflows/delete_old.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Delete old workflow runs
on:
workflow_dispatch:
inputs:
days:
description: 'Number of days.'
required: true
default: 90

jobs:
del_runs:
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
68 changes: 0 additions & 68 deletions .github/workflows/deploy.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:xenial
FROM debian:buster-slim
LABEL maintainer="[email protected]"

ENV PS3DEV /usr/local/ps3dev
Expand All @@ -9,9 +9,9 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN \
apt-get -y update && \
apt-get -y install \
autoconf bison build-essential ca-certificates flex git libelf-dev\
libgmp-dev libncurses5-dev libssl-dev libtool-bin pkg-config python-dev \
apt-get -y install libgmp-dev \
autoconf bison build-essential ca-certificates flex git libelf-dev \
libncurses5-dev libssl-dev libtool-bin pkg-config python-dev \
texinfo wget zlib1g-dev && \
apt-get -y clean autoclean autoremove && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
Expand Down
4 changes: 3 additions & 1 deletion depends/check-autoconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-autoconf.sh by Naomi Peori ([email protected])

## Check for autoconf.
autoconf --version 1>/dev/null 2>&1|| { echo "ERROR: Install autoconf before continuing."; exit 1; }
autoconf --version 1>/dev/null 2>&1 ||
{ echo "ERROR: Install autoconf before continuing."; exit 1; }
# sudo apt-get install autoconf
4 changes: 3 additions & 1 deletion depends/check-automake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-automake.sh by Naomi Peori ([email protected])

## Check for automake.
automake --version 1>/dev/null 2>&1 || { echo "ERROR: Install automake before continuing."; exit 1; }
automake --version 1>/dev/null 2>&1 ||
{ echo "ERROR: Install automake before continuing."; exit 1; }
# sudo apt-get install automake
4 changes: 3 additions & 1 deletion depends/check-bison.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
# check-bison.sh by Naomi Peori ([email protected])

( bison -V || yacc -V ) 1>/dev/null 2>&1 || { echo "ERROR: Install bison before continuing."; exit 1; }
( bison -V || yacc -V ) 1>/dev/null 2>&1 ||
{ echo "ERROR: Install bison before continuing."; exit 1; }
# sudo apt-get install bison
4 changes: 3 additions & 1 deletion depends/check-flex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-flex.sh by Naomi Peori ([email protected])

## Check for flex.
flex --version 1>/dev/null 2>&1 || { echo "ERROR: Install flex before continuing."; exit 1; }
flex --version 1>/dev/null 2>&1 ||
{ echo "ERROR: Install flex before continuing."; exit 1; }
# sudo apt-get install flex
4 changes: 3 additions & 1 deletion depends/check-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-gcc.sh by Naomi Peori ([email protected])

## Check for gcc.
gcc --version 1>/dev/null 2>&1 || { echo "ERROR: Install gcc before continuing."; exit 1; }
gcc --version 1>/dev/null 2>&1 ||
{ echo "ERROR: Install gcc before continuing."; exit 1; }
# sudo apt-get install gcc
10 changes: 9 additions & 1 deletion depends/check-gmp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/sh
# check-gmp.sh by Timothy Redaelli ([email protected])

[ -f /usr/include/$(gcc -dumpmachine)/gmp.h -o -f /usr/include/gmp.h -o -f /opt/local/include/gmp.h -o -f /usr/local/include/gmp.h -o -f /opt/csw/include/gmp.h ] || { echo "ERROR: Install gmp before continuing."; exit 1; }
# i386 dumpmachine returns i686-linux-gnu
[ -f /usr/include/"$(gcc -dumpmachine)"/gmp.h ] ||
[ -f /usr/include/i386-linux-gnu/gmp.h ] ||
[ -f /usr/include/gmp.h ] ||
[ -f /opt/local/include/gmp.h ] ||
[ -f /usr/local/include/gmp.h ] ||
[ -f /opt/csw/include/gmp.h ] ||
{ echo "ERROR: Install gmp before continuing."; exit 1; }
# sudo apt-get install libgmp-dev
8 changes: 7 additions & 1 deletion depends/check-libelf.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/sh
# check-libelf.sh by Naomi Peori ([email protected])

( ls /usr/include/libelf.h || ls /usr/local/include/libelf.h || ls /opt/local/include/libelf.h || ls /opt/local/include/libelf/libelf.h || ls /usr/local/include/libelf/libelf.h ) 1>/dev/null 2>&1 || { echo "ERROR: Install libelf before continuing."; exit 1; }
[ -f /usr/include/libelf.h ] ||
[ -f /usr/local/include/libelf.h ] ||
[ -f /opt/local/include/libelf.h ] ||
[ -f /opt/local/include/libelf/libelf.h ] ||
[ -f /usr/local/include/libelf/libelf.h ] ||
{ echo "ERROR: Install libelf before continuing."; exit 1; }
# sudo apt-get install libelf-dev
4 changes: 3 additions & 1 deletion depends/check-libtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-libtool.sh by Naomi Peori ([email protected])

## Check for libtool.
{ libtool --version || libtool -V; } 1>/dev/null 2>&1 || { echo "ERROR: Install libtool before continuing."; exit 1; }
{ libtool --version || libtool -V; } 1>/dev/null 2>&1 ||
{ echo "ERROR: Install libtool before continuing."; exit 1; }
# sudo apt-get install libtool-bin
4 changes: 3 additions & 1 deletion depends/check-make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-make.sh by Naomi Peori ([email protected])

## Check for make.
${MAKE:-make} -v 1>/dev/null 2>&1 || { echo "ERROR: Install make before continuing."; exit 1; }
${MAKE:-make} -v 1>/dev/null 2>&1 ||
{ echo "ERROR: Install make before continuing."; exit 1; }
# sudo apt-get install make
4 changes: 3 additions & 1 deletion depends/check-makeinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-makeinfo.sh by Naomi Peori ([email protected])

## Check for makeinfo.
makeinfo --version 1>/dev/null 2>&1 || { echo "ERROR: Install makeinfo before continuing."; exit 1; }
makeinfo --version 1>/dev/null 2>&1 ||
{ echo "ERROR: Install makeinfo before continuing."; exit 1; }
# sudo apt-get install texinfo
9 changes: 8 additions & 1 deletion depends/check-ncurses.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/sh
# check-ncurses.sh by Naomi Peori ([email protected])

( ls /usr/include/ncurses.h || ls /usr/include/ncurses/ncurses.h || ls /opt/local/include/ncurses.h || ls /usr/include/curses.h || ls /mingw/include/curses.h || ls /usr/local/opt/ncurses/include/ncurses.h ) 1>/dev/null 2>&1 || { echo "ERROR: Install ncurses before continuing."; exit 1; }
[ -f /usr/include/ncurses.h ] ||
[ -f /usr/include/ncurses/ncurses.h ] ||
[ -f /opt/local/include/ncurses.h ] ||
[ -f /usr/include/curses.h ] ||
[ -f /mingw/include/curses.h ] ||
[ -f /usr/local/opt/ncurses/include/ncurses.h ] ||
{ echo "ERROR: Install ncurses before continuing."; exit 1; }
# sudo apt-get install libncurses5-dev
4 changes: 3 additions & 1 deletion depends/check-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-patch.sh by Naomi Peori ([email protected])

## Check for patch.
patch -v 1>/dev/null 2>&1 || { echo "ERROR: Install patch before continuing."; exit 1; }
patch -v 1>/dev/null 2>&1 ||
{ echo "ERROR: Install patch before continuing."; exit 1; }
# sudo apt-get install patch
4 changes: 3 additions & 1 deletion depends/check-pkg-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# check-pkg-config.sh by Naomi Peori ([email protected])

## Check for pkg-config.
pkg-config --version 1>/dev/null 2>&1 || { echo "ERROR: Install pkg-config before continuing."; exit 1; }
pkg-config --version 1>/dev/null 2>&1 ||
{ echo "ERROR: Install pkg-config before continuing."; exit 1; }
# sudo apt-get install pkg-config
18 changes: 12 additions & 6 deletions depends/check-ps3dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
# check-ps3dev.sh by Naomi Peori ([email protected])

## Check if $PS3DEV is set.
if test ! $PS3DEV; then { echo "ERROR: Set \$PS3DEV before continuing."; exit 1; } fi
[ -z "$PS3DEV" ] &&
{ echo "ERROR: Set \$PS3DEV before continuing."; exit 1; }

## Check for the $PS3DEV directory.
( ls -ld $PS3DEV || mkdir -p $PS3DEV ) 1>/dev/null 2>&1 || { echo "ERROR: Create $PS3DEV before continuing."; exit 1; }
[ -d "$PS3DEV" ] || mkdir -p "$PS3DEV" 1>/dev/null 2>&1 ||
{ echo "ERROR: Create \"$PS3DEV\" before continuing."; exit 1; }

## Check for write permission.
touch $PS3DEV/test.tmp 1>/dev/null 2>&1 || { echo "ERROR: Grant write permissions for $PS3DEV before continuing."; exit 1; }
[ -w "$PS3DEV" ] ||
{ echo "ERROR: Grant write permissions for \"$PS3DEV\" to $USER before continuing."; exit 1; }

## Check for $PS3DEV/bin in the path.
echo $PATH | grep $PS3DEV/bin 1>/dev/null 2>&1 || { echo "ERROR: Add $PS3DEV/bin to your path before continuing."; exit 1; }
echo ":$PATH:" | grep ":$PS3DEV/bin:" 1>/dev/null 2>&1 ||
{ echo "ERROR: Add \"$PS3DEV/bin\" to your path before continuing."; exit 1; }

## Check for $PS3DEV/ppu/bin in the path.
echo $PATH | grep $PS3DEV/ppu/bin 1>/dev/null 2>&1 || { echo "ERROR: Add $PS3DEV/ppu/bin to your path before continuing."; exit 1; }
echo ":$PATH:" | grep ":$PS3DEV/ppu/bin:" 1>/dev/null 2>&1 ||
{ echo "ERROR: Add \"$PS3DEV/ppu/bin\" to your path before continuing."; exit 1; }

## Check for $PS3DEV/spu/bin in the path.
echo $PATH | grep $PS3DEV/spu/bin 1>/dev/null 2>&1 || { echo "ERROR: Add $PS3DEV/spu/bin to your path before continuing."; exit 1; }
echo ":$PATH:" | grep ":$PS3DEV/spu/bin:" 1>/dev/null 2>&1 ||
{ echo "ERROR: Add \"$PS3DEV/spu/bin\" to your path before continuing."; exit 1; }
9 changes: 6 additions & 3 deletions depends/check-psl1ght.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# check-psl1ght.sh by Naomi Peori ([email protected])

## Check if $PSL1GHT is set.
if test ! $PSL1GHT; then { echo "ERROR: Set \$PSL1GHT before continuing."; exit 1; } fi
[ -z "$PSL1GHT" ] &&
{ echo "ERROR: Set \$PSL1GHT before continuing."; exit 1; }

## Check for the $PSL1GHT directory.
( ls -ld $PSL1GHT || mkdir -p $PSL1GHT ) 1>/dev/null 2>&1 || { echo "ERROR: Create $PSL1GHT before continuing."; exit 1; }
[ -d "$PSL1GHT" ] || mkdir -p "$PSL1GHT" 1>/dev/null 2>&1 ||
{ echo "ERROR: Create \"$PSL1GHT\" before continuing."; exit 1; }

## Check for write permission.
touch $PSL1GHT/test.tmp 1>/dev/null 2>&1 || { echo "ERROR: Grant write permissions for $PSL1GHT before continuing."; exit 1; }
[ -w "$PSL1GHT" ] ||
{ echo "ERROR: Grant write permissions for $PSL1GHT before continuing."; exit 1; }
Loading