-
Notifications
You must be signed in to change notification settings - Fork 24
58 lines (48 loc) · 1.38 KB
/
test_pre_commit.yaml
File metadata and controls
58 lines (48 loc) · 1.38 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
56
57
58
name: Run pre-commit
on:
# Run pre-commit on pull requests
pull_request:
# Add a workflow_dispatch event to run pre-commit manually
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
lint:
runs-on: "ubuntu-22.04"
timeout-minutes: 30
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Pixi
run: |
curl -fsSL https://pixi.sh/install.sh | bash
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: Add Modular to Pixi
run: |
export PATH="$HOME/.pixi/bin:$PATH"
pixi install
- name: Set up Modular environment
run: |
echo "MODULAR_HOME=$HOME/.modular" >> $GITHUB_ENV
echo "$HOME/.modular/bin" >> $GITHUB_PATH
echo "$HOME/.modular/pkg/packages.modular.com_mojo/bin" >> $GITHUB_PATH
- name: Setup Python virtualenv
run: |
python3 -m venv $HOME/venv/
. $HOME/venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install pre-commit
run: |
pip install pre-commit
pre-commit install
- name: Run pre-commit
run: |
export PATH="$HOME/.pixi/bin:$PATH"
pixi install
pre-commit run --all-files