forked from JPEWdev/shacl2code
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 3.2 KB
/
Copy pathtest.yaml
File metadata and controls
102 lines (99 loc) · 3.2 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
---
name: Test shacl2code
on:
push:
# Skip changes in docs and other workflows
paths: &trigger-paths
- "**"
- "!**/*.md"
- "!LICENSE"
- "!.github/ISSUE_TEMPLATE/**"
- "!.github/workflows/**"
- ".github/workflows/test.yaml"
pull_request:
paths: *trigger-paths
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- os: macos-latest
python-version: "3.10"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: npm
cache-dependency-path: scripts/package-lock.json
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
npm install -g jsonld-cli
npm --prefix scripts ci
- name: Install Linux packages
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y build-essential cppcheck doxygen graphviz ccache
- name: Install macOS packages
if: runner.os == 'macOS'
run: |
brew update
brew install cppcheck doxygen gcc go graphviz ccache
- name: Install Go static analysis tools
run: |
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Install Rust static analysis tools
run: |
rustup component add clippy
- name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.python-version }}
- name: Build package
run: |
python -m build
- name: Install package
run: |
pip install -e .[dev]
- name: Run tests
run: |
pytest -v
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
# Black in this Python version must support all target-versions listed in pyproject.toml
python-version: "3.14"
cache: pip
- uses: psf/black@87928e6d6761a4a6d22250e1fee5601b3998086e # 26.5.1
- uses: py-actions/flake8@84ec6726560b6d5bd68f2a5bed83d62b52bb50ba # v2.3.0
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install clang-format
- name: Check code formatting
run: |
./scripts/format.sh
git diff --exit-code