forked from nautechsystems/nautilus_trader
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.66 KB
/
Copy pathcodeql-analysis.yml
File metadata and controls
76 lines (66 loc) · 2.66 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
name: codeql-analysis
permissions: # Principle of least privilege
contents: read
actions: read
security-events: write # Required for CodeQL to upload SARIF
on:
workflow_dispatch:
pull_request:
branches: [master]
push:
branches: [nightly]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ["python", "rust"]
steps:
# https://github.com/step-security/harden-runner
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: ${{ vars.STEP_SECURITY_EGRESS_POLICY || 'block' }}
allowed-endpoints: >-
${{ vars.COMMON_ALLOWED_ENDPOINTS }}
${{ vars.CI_ALLOWED_ENDPOINTS }}
- name: Checkout repository
# https://github.com/actions/checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
fetch-depth: 1
- name: Install Rust linker (lld)
if: matrix.language == 'rust'
run: |
sudo apt-get update -o Acquire::Retries=5
sudo apt-get install -y lld -o Acquire::Retries=5
- name: Get Rust toolchain version
if: matrix.language == 'rust'
id: rust-toolchain
run: |
echo "TOOLCHAIN=$(bash scripts/rust-toolchain.sh)" >> "$GITHUB_ENV"
# https://github.com/actions-rust-lang/setup-rust-toolchain
- name: Set up Rust toolchain
if: matrix.language == 'rust'
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: ${{ env.TOOLCHAIN }}
override: true
- name: Initialize CodeQL
# https://github.com/github/codeql-action
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# https://github.com/github/codeql-action
- name: Autobuild
if: matrix.language == 'rust'
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
- name: Perform CodeQL Analysis
# https://github.com/github/codeql-action
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2