-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (46 loc) · 1.31 KB
/
pre-commit-format.yml
File metadata and controls
55 lines (46 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Formatting
on:
workflow_dispatch:
pull_request:
branches:
- "**"
merge_group:
branches: [main]
# schedule:
# - cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
formatting-checks:
runs-on: ubuntu-22.04
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Setup Python environment (for pre-commit)
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Clean dotnet temporary folder
run: |
sudo rm -rf /tmp/.dotnet
mkdir -p ${{ runner.temp }}/dotnet-home
mkdir -p ${{ runner.temp }}/xdg-runtime
- name: Install pre-commit and dependencies
run: |
pip install pre-commit
pre-commit install-hooks
- name: Run pre-commit checks
env:
TMPDIR: ${{ runner.temp }}
DOTNET_CLI_HOME: ${{ runner.temp }}/dotnet-home
XDG_RUNTIME_DIR: ${{ runner.temp }}/xdg-runtime
NUGET_PACKAGES: ${{ runner. temp }}/nuget-packages
run: |
pre-commit run --all-files