├── Dockerfile ├── LICENSE ├── README.md ├── action.yml └── lint.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | RUN apt-get update 4 | RUN apt-get install --yes bzip2 wget libxext6 libllvm6.0 mesa-utils 5 | 6 | COPY lint.sh /lint.sh 7 | 8 | ENTRYPOINT ["/lint.sh"] 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2019, Project Alice 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lint Ren'Py Project 2 | 3 | This GitHub action allows you to run the linter on a Ren'Py visual novel project in a workflow for testing purposes. 4 | 5 | ## Usage 6 | 7 | ```yml 8 | - name: Lint VN project 9 | uses: ProjectAliceDev/renpy-lint-action@master 10 | with: 11 | sdk-version: '6.99.12.4' 12 | project-dir: '.' 13 | env: 14 | SDL_AUDIODRIVER: dummy 15 | SDL_VIDEODRIVER: dummy 16 | ``` 17 | or to reuse a previously cached download of the sdk utilizing the [GitHub Cache Action](https://github.com/marketplace/actions/cache) 18 | ```yml 19 | - name: Get SDK Version from config 20 | id: lookupSdkVersion 21 | uses: devorbitus/yq-action-output@v1.0 22 | with: 23 | # The file path would be to wherever this file is located 24 | cmd: yq eval '.jobs.build.steps[] | select(.id == "lintProject") | .with.sdk-version' .github/workflows/renpy-linter-action.yml 25 | - name: Restore Cache 26 | id: restore-cache 27 | uses: actions/cache@v2 28 | with: 29 | path: ../renpy 30 | key: ${{ runner.os }}-sdk-${{ steps.lookupSdkVersion.outputs.result }} 31 | - name: Lint VN project 32 | id: lintProject 33 | uses: ProjectAliceDev/renpy-lint-action@master 34 | with: 35 | sdk-version: '6.99.12.4' 36 | project-dir: '.' 37 | env: 38 | SDL_AUDIODRIVER: dummy 39 | SDL_VIDEODRIVER: dummy 40 | - name: Cache SDK 41 | id: save-cache 42 | if: steps.restore-cache.outputs.cache-hit != 'true' 43 | uses: actions/cache@v2 44 | with: 45 | path: ../renpy 46 | key: ${{ runner.os }}-sdk-${{ steps.lookupSdkVersion.outputs.result }} 47 | ``` 48 | 49 | **Required Parameters:** 50 | 51 | - `sdk-version`: The version of the Ren'Py SDK to use while linting. Will default to `7.3.2` if none is found. 52 | - `project-dir`: The directory where the project exists. Will default to `'.'` (root) if none is found. 53 | 54 | > :warning: If you are targeting Ren'Py v7.4.0+, you **must** use v1.1.1 of this action or greater. 55 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Lint Ren'Py Project" 2 | author: 'Project Alice' 3 | description: "Lint your project against a specified Ren'Py SDK version" 4 | inputs: 5 | sdk-version: 6 | description: "The version of the Ren'Py SDK to use" 7 | required: true 8 | default: '7.3.2' 9 | project-dir: 10 | description: "The path to the directory where the project exists" 11 | required: true 12 | default: '.' 13 | runs: 14 | using: 'docker' 15 | image: 'Dockerfile' 16 | args: 17 | - ${{ inputs.sdk-version }} 18 | - ${{ inputs.project-dir }} 19 | branding: 20 | color: 'green' 21 | icon: 'check' 22 | -------------------------------------------------------------------------------- /lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sdk_name=renpy-$1-sdk 4 | if [ "$(ls -A ../renpy)" ]; then 5 | echo "Cached copy of sdk found. No additional downloading required." 6 | else 7 | echo "Downloading the specified SDK (${sdk_name})..." 8 | wget https://www.renpy.org/dl/$1/${sdk_name}.tar.bz2 9 | clear 10 | 11 | echo "Downloaded SDK version (${sdk_name})." 12 | echo "Setting up the specified SDK (${sdk_name})..." 13 | tar -xf ./${sdk_name}.tar.bz2 14 | rm ./${sdk_name}.tar.bz2 15 | mv ./${sdk_name} ../renpy 16 | fi 17 | 18 | echo "Linting the project at '$2'..." 19 | rm -rf game/README.html 20 | ../renpy/renpy.sh $2 lint 21 | --------------------------------------------------------------------------------