forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (108 loc) · 3.99 KB
/
Copy pathprechecks.yml
File metadata and controls
117 lines (108 loc) · 3.99 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: prechecks
on:
workflow_call:
inputs:
with_coverage:
required: true
type: string
with_packages:
required: true
type: string
concurrency:
group: style-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true
jobs:
# Validate that the code can be run on all the Python versions supported by Spack
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: '3.13'
- name: Install Python Packages
run: |
pip install -r .github/workflows/requirements/style/requirements.txt
- name: vermin
run: |
vermin --backport importlib \
--backport argparse \
--violations \
--backport typing \
-t=3.6- \
-vvv \
--exclude-regex lib/spack/spack/vendor \
lib/spack/spack/ lib/spack/llnl/ bin/ var/spack/test_repos
# Run style checks on the files that have been changed
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: '3.13'
- name: Install Python packages
run: |
pip install -r .github/workflows/requirements/style/requirements.txt
- name: Run style tests (code)
run: |
bin/spack style --base HEAD^1
bin/spack license verify
pylint -j $(nproc) --disable=all --enable=unspecified-encoding --ignore-paths=lib/spack/spack/vendor lib
- name: Run style tests (docs)
run: .github/workflows/bin/format-rst.py $(git ls-files 'lib/spack/docs/*.rst')
# Check that spack can bootstrap the development environment on Python 3.6 - RHEL8
bootstrap-dev-rhel8:
runs-on: ubuntu-latest
container: registry.access.redhat.com/ubi8/ubi
steps:
- name: Install dependencies
run: |
dnf install -y \
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
make patch tcl unzip which xz
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup repo and non-root user
run: |
git --version
git config --global --add safe.directory '*'
git fetch --unshallow
. .github/workflows/bin/setup_git.sh
useradd spack-test
chown -R spack-test .
- name: Bootstrap Spack development environment
shell: runuser -u spack-test -- bash {0}
run: |
source share/spack/setup-env.sh
spack debug report
spack -d bootstrap now --dev
spack -d style -t black
spack unit-test -V
canonicalization:
name: package.py canonicalization
runs-on: ubuntu-latest
container:
image: ghcr.io/spack/all-pythons:2025-07-25
steps:
- name: Checkout Spack (current)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
path: spack-current
- name: Checkout Spack (previous)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
path: spack-previous
ref: ${{ github.event.pull_request.base.sha || github.event.before }}
- name: Checkout Spack Packages
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: spack/spack-packages
path: spack-packages
- name: Test package.py canonicalization
run: spack-current/.github/workflows/bin/canonicalize.py
--spack $PWD/spack-previous $PWD/spack-current
--python python3.6 python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 python3.13
--input-dir spack-packages/repos/spack_repo/builtin/packages/
--output-dir canonicalized