Skip to content

Commit 9ef042b

Browse files
committed
CI: Add CodeQL
1 parent 7a9c207 commit 9ef042b

4 files changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/ci-xtgeoviz.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ on:
1414
# Run nightly to check that tests are working with latest dependencies
1515
- cron: "0 0 * * *"
1616

17+
permissions: {}
18+
1719
jobs:
1820
test:
1921
strategy:
2022
matrix:
2123
python-version: ["3.9", "3.10", "3.11", "3.12"]
2224
runs-on: [ubuntu-latest]
25+
permissions:
26+
contents: write # Write needed for docs
27+
pull-requests: write
2328
env:
2429
MPLBACKEND: Agg
2530

.github/workflows/codeql.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main, "version-*"]
6+
pull_request:
7+
branches: [main, "version-*"]
8+
schedule:
9+
- cron: "0 0 * * *"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
packages: read
18+
actions: read
19+
contents: read
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- language: actions
26+
build-mode: none
27+
- language: python
28+
build-mode: none
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Initialize CodeQL
35+
uses: github/codeql-action/init@v3
36+
with:
37+
languages: ${{ matrix.language }}
38+
build-mode: ${{ matrix.build-mode }}
39+
40+
- name: Perform CodeQL Analysis
41+
uses: github/codeql-action/analyze@v3
42+
with:
43+
category: "/language:${{matrix.language}}"

.github/workflows/linting.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
# Run nightly to check that tests are working with latest dependencies
1515
- cron: "0 0 * * *"
1616

17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
1721
jobs:
1822
lint:
1923
runs-on: ubuntu-latest

.github/workflows/xtgeoviz-publish-pypi.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
release:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
711
jobs:
812
build-n-publish:
913
name: Build and publish Python 🐍 distributions 📦 to PyPI

0 commit comments

Comments
 (0)