Skip to content

Commit d85140f

Browse files
committed
More precommit
1 parent 4f08d03 commit d85140f

File tree

2 files changed

+6
-64
lines changed

2 files changed

+6
-64
lines changed

template/.github/workflows/publish.yaml.jinja

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,9 @@ jobs:
3838

3939
lint:
4040
name: Pre-commit
41-
runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %}
42-
steps:
43-
- name: Checkout code
44-
uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %}
45-
46-
- name: Install latest versions of python packages
47-
uses: ./.github/actions/install_deps
48-
with:
49-
python-version: {% endraw %}{{ python_version }}{% if python_package_registry == "AWS CodeArtifact" %}{% raw %}
50-
code-artifact-auth-role-name: CoreInfraBaseAccess
51-
code-artifact-auth-role-account-id: {% endraw %}{{ aws_central_infrastructure_account_id }}{% raw %}
52-
code-artifact-auth-region: {% endraw %}{{ aws_org_home_region }}{% endif %}{% raw %}
53-
54-
- name: Set up mutex # Github concurrency management is horrible, things get arbitrarily cancelled if queued up. So using mutex until github fixes itself. When multiple jobs are modifying cache at once, weird things can happen. possible issue is https://github.com/actions/toolkit/issues/658
55-
if: ${{ runner.os != 'Windows' }} # we're just gonna have to YOLO on Windows, because this action doesn't support it yet https://github.com/ben-z/gh-action-mutex/issues/14
56-
uses: ben-z/gh-action-mutex@{% endraw %}{{ gha_mutex }}{% raw %}
57-
with:
58-
branch: mutex-venv-{% endraw %}{{ gha_linux_runner }}{% raw %}-py{% endraw %}{{ python_version }}{% raw %}
59-
timeout-minutes: 30 # this is the amount of time this action will wait to attempt to acquire the mutex lock before failing, e.g. if other jobs are queued up in front of it
60-
61-
- name: Cache Pre-commit hooks
62-
uses: actions/cache@{% endraw %}{{ gha_cache }}{% raw %}
63-
env:
64-
cache-name: cache-pre-commit-hooks
65-
with:
66-
path: ${{ env.PRE_COMMIT_HOME }}
67-
key: {% endraw %}{{ gha_linux_runner }}{% raw %}-py{% endraw %}{{ python_version }}{% raw %}-build-${{ env.cache-name }}-${{ hashFiles('.pre-commit-config.yaml') }}
68-
restore-keys: |
69-
{% endraw %}{{ gha_linux_runner }}{% raw %}-py{% endraw %}{{ python_version }}{% raw %}-build-${{ env.cache-name }}-
70-
71-
- name: Run pre-commit
72-
run: pre-commit run -a
41+
uses: ./.github/workflows/pre-commit.yaml
42+
with:
43+
python-version: {% endraw %}{{ python_version }}{% raw %}
7344

7445
test:
7546
needs: [ lint ]

template/.github/workflows/publish_to_staging.yaml.jinja

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,9 @@ permissions:
1414
jobs:
1515
lint:
1616
name: Pre-commit
17-
runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %}
18-
steps:
19-
- name: Checkout code
20-
uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %}
21-
22-
- name: Install latest versions of python packages
23-
uses: ./.github/actions/install_deps
24-
with:
25-
python-version: {% endraw %}{{ python_version }}{% if python_package_registry == "AWS CodeArtifact" %}{% raw %}
26-
code-artifact-auth-role-name: CoreInfraBaseAccess
27-
code-artifact-auth-role-account-id: {% endraw %}{{ aws_central_infrastructure_account_id }}{% raw %}
28-
code-artifact-auth-region: {% endraw %}{{ aws_org_home_region }}{% endif %}{% raw %}
29-
30-
- name: Set up mutex # Github concurrency management is horrible, things get arbitrarily cancelled if queued up. So using mutex until github fixes itself. When multiple jobs are modifying cache at once, weird things can happen. possible issue is https://github.com/actions/toolkit/issues/658
31-
if: ${{ runner.os != 'Windows' }} # we're just gonna have to YOLO on Windows, because this action doesn't support it yet https://github.com/ben-z/gh-action-mutex/issues/14
32-
uses: ben-z/gh-action-mutex@{% endraw %}{{ gha_mutex }}{% raw %}
33-
with:
34-
branch: mutex-venv-{% endraw %}{{ gha_linux_runner }}{% raw %}-py{% endraw %}{{ python_version }}{% raw %}
35-
timeout-minutes: 30 # this is the amount of time this action will wait to attempt to acquire the mutex lock before failing, e.g. if other jobs are queued up in front of it
36-
37-
- name: Cache Pre-commit hooks
38-
uses: actions/cache@{% endraw %}{{ gha_cache }}{% raw %}
39-
env:
40-
cache-name: cache-pre-commit-hooks
41-
with:
42-
path: ${{ env.PRE_COMMIT_HOME }}
43-
key: {% endraw %}{{ gha_linux_runner }}{% raw %}-py{% endraw %}{{ python_version }}{% raw %}-build-${{ env.cache-name }}-${{ hashFiles('.pre-commit-config.yaml') }}
44-
restore-keys: |
45-
{% endraw %}{{ gha_linux_runner }}{% raw %}-py{% endraw %}{{ python_version }}{% raw %}-build-${{ env.cache-name }}-
46-
47-
- name: Run pre-commit
48-
run: pre-commit run -a
17+
uses: ./.github/workflows/pre-commit.yaml
18+
with:
19+
python-version: {% endraw %}{{ python_version }}{% raw %}
4920

5021
test:
5122
needs: [ lint ]

0 commit comments

Comments
 (0)