Skip to content

Commit

Permalink
Merge branch 'main' into numeric_underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
latonis committed Feb 21, 2024
2 parents bf8cb82 + 40d982f commit 8abdf0c
Show file tree
Hide file tree
Showing 388 changed files with 3,180 additions and 907 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/code_health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.71.0
- uses: dtolnay/rust-toolchain@1.73.0
with:
components: clippy
- run: cargo clippy --tests --no-deps --all-features -- --deny clippy::all
Expand All @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.71.0
- uses: dtolnay/rust-toolchain@1.73.0
with:
components: rustfmt
- run: cargo fmt --all --check
Expand All @@ -36,5 +36,5 @@ jobs:
- name: Run cargo-udeps
uses: aig787/cargo-udeps-action@v1
with:
version: v0.1.35
version: v0.1.45
args: '--all-targets'
69 changes: 69 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '36 18 * * 4'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'go', 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
10 changes: 7 additions & 3 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Code coverage with grcov

on:
schedule:
# Run at every day at 2:15.
schedule:
- cron: '15 2 * * *'

# Also run then this file is changed.
push:
paths:
- '.github/workflows/coverage.yaml'
jobs:
coverage:
name: Coverage
Expand All @@ -27,7 +30,8 @@ jobs:
run: cargo llvm-cov --workspace --lib --lcov --output-path lcov.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
67 changes: 67 additions & 0 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Golang package

on:
push:
paths:
- 'go/**'
- '.github/workflows/golang.yaml'

permissions:
contents: read

jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [ '1.19', '1.20', '1.21.x' ]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

# Install OpenSSL on Windows
- name: Install OpenSSL
if: runner.os == 'Windows'
id: vcpkg
uses: johnwason/vcpkg-action@v5
with:
pkgs: openssl
triplet: x64-windows-static
token: ${{ github.token }}

- name: Set OPENSSL_DIR environment variable
if: runner.os == 'Windows'
shell: bash
run: echo "OPENSSL_DIR=${{ github.workspace }}\\vcpkg\\installed\\x64-windows-static" >> $GITHUB_ENV

# Install OpenSSL on Linux
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev
- name: Build Rust library
run: cargo build --release -p yara-x -p yara-x-capi

- name: Set LD_LIBRARY_PATH environment variable
if: runner.os == 'Linux'
shell: bash
run: echo "LD_LIBRARY_PATH=${{ github.workspace }}/target/release" >> $GITHUB_ENV

- name: Run Go tests
run: |
cd go
go test
10 changes: 5 additions & 5 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Python extension
on:
push:
paths:
- 'yara-x-py/**'
- 'py/**'
- '.github/workflows/python.yaml'

permissions:
Expand Down Expand Up @@ -47,8 +47,8 @@ jobs:
pwd
python -m pip install --upgrade pip maturin
python -m pip install pytest
maturin develop --manifest-path yara-x-py/Cargo.toml
pytest yara-x-py
maturin develop --manifest-path py/Cargo.toml
pytest py
# Non-windows
- name: Test Python - Non-Windows
Expand All @@ -58,6 +58,6 @@ jobs:
virtualenv venv; source venv/bin/activate
python -m pip install --upgrade pip maturin
python -m pip install pytest
maturin develop --manifest-path yara-x-py/Cargo.toml
pytest yara-x-py
maturin develop --manifest-path py/Cargo.toml
pytest py
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
include:
- build: msrv
os: ubuntu-latest
rust: 1.71.0
rust: 1.73.0
args: ""

- build: stable
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand Down
Loading

0 comments on commit 8abdf0c

Please sign in to comment.