ci: some fixes #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-c | |
- 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 |