diff --git a/.github/workflows/commit-checker.yml b/.github/workflows/commit-checker.yml index 05e31502..511e6f3b 100644 --- a/.github/workflows/commit-checker.yml +++ b/.github/workflows/commit-checker.yml @@ -10,35 +10,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 4 - name: Get pull-request commits - run: | - # actions/checkout did a merge checkout of the pull-request. As such, the first - # commit is the merge commit. This means that on HEAD^ is the base branch, and - # on HEAD^2 are the commits from the pull-request. We now check if those trees - # have a common parent. If not, we fetch a few more commits till we do. In result, - # the log between HEAD^ and HEAD^2 will be the commits in the pull-request. - DEPTH=4 - while [ -z "$(git merge-base HEAD^ HEAD^2)" ]; do - git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --deepen=${DEPTH} origin HEAD - DEPTH=$(( ${DEPTH} * 4 )) - done - - # Just to show which commits we are going to evaluate. - echo "Commits in this pull-request:" - git log --oneline HEAD^..HEAD^2 - - - name: Checkout commit-checker - uses: actions/checkout@v3 - with: - repository: OpenTTD/OpenTTD-git-hooks - path: git-hooks - ref: master + uses: OpenTTD/actions/checkout-pull-request@v5 - name: Check commits - run: | - HOOKS_DIR=./git-hooks/hooks GIT_DIR=.git ./git-hooks/hooks/check-commits.sh HEAD^..HEAD^2 - echo "Commit checks passed" + uses: OpenTTD/OpenTTD-git-hooks@main diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index e43f23d7..34766ba0 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -25,17 +25,17 @@ jobs: python-version: pypy3.7 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 2 - name: Checkout tags - uses: openttd/actions/checkout@v2 - with: - with-tags: true + shell: bash + run: | + git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f0bf6d9..fca70965 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,17 +10,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Checkout tags - uses: openttd/actions/checkout@v2 - with: - with-tags: true + shell: bash + run: | + git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' cache: 'pip' @@ -50,17 +50,17 @@ jobs: runs-on: macOS-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Checkout tags - uses: openttd/actions/checkout@v2 - with: - with-tags: true + shell: bash + run: | + git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' cache: 'pip' @@ -90,17 +90,17 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Checkout tags - uses: openttd/actions/checkout@v2 - with: - with-tags: true + shell: bash + run: | + git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' cache: 'pip' diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 97a52ada..2427c396 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,20 +14,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install dependencies run: python -m pip install -e . - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: python queries: security-and-quality - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 testing: name: Python 3.x on ${{ matrix.os }} @@ -38,10 +38,10 @@ jobs: os: [ubuntu-latest, macOS-latest, windows-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' cache: 'pip' @@ -61,23 +61,18 @@ jobs: flake8: name: Flake8 - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Flake8 - uses: TrueBrain/actions-flake8@v2 - with: - path: nml + uses: OpenTTD/actions/.github/workflows/rw-py-flake8.yml@v5 + with: + python-path: nml black: name: Black runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - - name: Set up Python 3.6 - uses: actions/setup-python@v4 + uses: actions/checkout@v4 + - name: Set up Python 3.7 + uses: actions/setup-python@v5 with: python-version: 3.7 - name: Black