diff --git a/.gitattributes b/.gitattributes index 0e1a2f6..b9f9327 100644 --- a/.gitattributes +++ b/.gitattributes @@ -30,6 +30,7 @@ /.import export-ignore /LICENSE.md export-ignore /misc export-ignore +/.pre-commit-config.yaml export-ignore /project.godot export-ignore /README.md export-ignore /requirements.txt export-ignore diff --git a/.github/actions/cache-submodules/action.yaml b/.github/actions/cache-submodules/action.yaml new file mode 100644 index 0000000..4354b56 --- /dev/null +++ b/.github/actions/cache-submodules/action.yaml @@ -0,0 +1,32 @@ +name: Cache dependencies +inputs: + platform: + required: true + target: + required: true + bits: + required: true +outputs: + cache-hit: + value: ${{ steps.cache.outputs.cache-hit }} +runs: + using: "composite" + steps: + - name: Hash submodule revisions + id: hash + working-directory: addons/godot_xterm/native/thirdparty + shell: bash + run: | + cache_version=1 # Increment this number to invalidate the cache. + godot_cpp_rev=$(git ls-tree HEAD godot-cpp --object-only) + libuv_rev=$(git ls-tree HEAD libuv --object-only) + libtsm_rev=$(git ls-tree HEAD libtsm --object-only) + hash_cmd=$([[ $RUNNER_OS == 'Windows' ]] && echo 'sha1sum' || echo 'shasum') + hash_of_hashes=$(echo -n "$godot_cpp_rev$libuv_rev$libtsm_rev$cache_version" | $hash_cmd | head -c 40) + echo "name=hash::$hash_of_hashes" >> $GITHUB_OUTPUT + - name: Cache submodules + uses: actions/cache@v3 + id: cache + with: + path: addons/godot_xterm/native/thirdparty + key: thirdparty-${{ inputs.platform }}-${{ inputs.bits }}-${{ inputs.target }}-${{ steps.hash.outputs.hash }} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f34e421 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "14:44" + timezone: UTC + open-pull-requests-limit: 10 + commit-message: + prefix: "chore" + include: "scope" + labels: + - "dependabot" + - "dependencies" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66eb060..73a504b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [ubuntu-22.04] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Import assets uses: ./.github/actions/import-assets with: @@ -136,7 +136,7 @@ jobs: scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} generate_bindings=yes -j2 - name: Setup cmake if: steps.cache-submodules.outputs.cache-hit != 'true' - uses: jwlawson/actions-setup-cmake@v1 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: "3.23.2" use-32bit: ${{ matrix.bits == 32 && matrix.os == 'windows-2022' }} @@ -198,7 +198,7 @@ jobs: - name: Import assets uses: ./.github/actions/import-assets - name: Export HTML5 - uses: nick-fields/retry@v2 + uses: nick-fields/retry@v3 with: command: godot --no-window --export HTML5 retry_on: error @@ -325,7 +325,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.9 cache: "pip" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fec2f45 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: none +# SPDX-License-Identifier: CC0-1.0 +ci: + autofix_commit_msg: "fix: auto fixes" + autoupdate_commit_msg: "chore: autoupdate" +exclude: "^addons/gut/" +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-yaml + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier