Update info about Rain World #1406
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR/Commit validation of FPSLocker Patches | |
| on: | |
| pull_request: | |
| branches: | |
| - v4 | |
| push: | |
| branches: | |
| - v4 | |
| workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
| jobs: | |
| validate-patches: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up GCC and build tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential gcc g++ | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Clone FPSLocker repository | |
| run: | | |
| git clone https://github.com/masagrator/FPSLocker.git FPSLocker | |
| - name: Build FPSLocker tester | |
| run: | | |
| cd FPSLocker/tester | |
| python run.py | |
| - name: Verify my_program executable exists | |
| run: | | |
| if [ ! -f "FPSLocker/tester/my_program" ]; then | |
| echo "Error: my_program executable not found" | |
| exit 1 | |
| fi | |
| - name: Find and validate all YAML patch files | |
| run: | | |
| PATCH_DIR="${GITHUB_WORKSPACE}/SaltySD/plugins/FPSLocker/patches" | |
| EXECUTABLE="${GITHUB_WORKSPACE}/FPSLocker/tester/my_program" | |
| FAILED=0 | |
| if [ ! -d "$PATCH_DIR" ]; then | |
| echo "Error: Patches directory not found at $PATCH_DIR" | |
| exit 1 | |
| fi | |
| # Find all .yaml files recursively | |
| while IFS= read -r yaml_file; do | |
| echo "Validating: $yaml_file" | |
| # Execute my_program with the yaml file path | |
| if "$EXECUTABLE" "$yaml_file"; then | |
| # Extract filename without extension | |
| filename=$(basename "$yaml_file" .yaml) | |
| echo "Checking if '$filename' exists in the file with a leading space..." | |
| # Check if the filename (with a leading space) exists in the file | |
| if grep -q " $filename" "$yaml_file"; then | |
| echo "✓ Found ' $filename' in $yaml_file" | |
| else | |
| echo "✗ Error: ' $filename' not found in $yaml_file" | |
| FAILED=1 | |
| fi | |
| else | |
| echo "Failed validation for: $yaml_file" | |
| FAILED=1 | |
| fi | |
| done < <(find "$PATCH_DIR" -type f -name "*.yaml") | |
| if [ $FAILED -eq 1 ]; then | |
| echo "One or more patch files failed validation" | |
| exit 1 | |
| fi | |
| echo "All patch files validated successfully" | |
| - name: Report results | |
| if: always() | |
| run: | | |
| if [ $? -eq 0 ]; then | |
| echo "✓ PR validation passed" | |
| else | |
| echo "✗ PR validation failed" | |
| exit 1 | |
| fi |