-
Notifications
You must be signed in to change notification settings - Fork 74
50 lines (39 loc) · 1.16 KB
/
prek-check.yml
File metadata and controls
50 lines (39 loc) · 1.16 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
# SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network>
#
# SPDX-License-Identifier: Apache-2.0
name: Prek checks
on:
push:
branches: [ master, next, dev-* ]
pull_request:
branches: [ master, next, dev-* ]
permissions:
contents: read
jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.92.0
components: rustfmt
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install prek
run: pip install prek
- name: Run prek checks (PR)
if: github.event_name == 'pull_request'
run: prek run --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} --show-diff-on-failure
- name: Run prek checks (push)
if: github.event_name == 'push'
run: prek run --from-ref ${{ github.event.before }} --to-ref ${{ github.event.after }} --show-diff-on-failure