Skip to content

Commit 2fe1f45

Browse files
committed
Try running tests in a container
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent 629b29f commit 2fe1f45

File tree

2 files changed

+32
-41
lines changed

2 files changed

+32
-41
lines changed

.github/workflows/go-tests.yaml

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -17,56 +17,26 @@ permissions:
1717
jobs:
1818
test:
1919
runs-on: mal-ubuntu-latest-8-core
20-
env:
21-
PKG_CONFIG_PATH: ${{ github.workspace }}
22-
LD_LIBRARY_PATH: ${{ github.workspace }}
20+
container: cgr.dev/chainguard/wolfi-base:latest
21+
# env:
22+
# PKG_CONFIG_PATH: ${{ github.workspace }}
23+
# LD_LIBRARY_PATH: ${{ github.workspace }}
2324
steps:
25+
- name: Install dependencies
26+
run: |
27+
apk update
28+
apk add curl findutils git go nodejs xz yara-x-compat
29+
2430
- uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
2531
with:
2632
egress-policy: audit
2733

2834
- name: Checkout code
2935
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3036

31-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
32-
with:
33-
go-version-file: go.mod
34-
check-latest: true
35-
36-
- uses: chainguard-dev/actions/goimports@9d943fc9889a0c0795e3c2bd4b949a9b610ac02e # main
37-
38-
- name: install dependencies
39-
run: |
40-
sudo apt update && sudo apt install xz-utils -y
41-
42-
- name: Clone yara-x
43-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44-
with:
45-
repository: VirusTotal/yara-x
46-
path: yara-x
47-
48-
- name: Setup Rust
49-
uses: dtolnay/rust-toolchain@315e265cd78dad1e1dcf3a5074f6d6c47029d5aa # ???
50-
with:
51-
toolchain: stable
52-
53-
- name: Install yara-x-capi
37+
- name: Run golangci-lint
5438
run: |
55-
cd ${{ github.workspace }}/yara-x
56-
cargo install cargo-c
57-
cargo cinstall -p yara-x-capi --release --destdir /tmp/yara-x
58-
sudo mkdir -p /usr/local/lib
59-
sudo mkdir -p /usr/local/include
60-
sudo cp /tmp/yara-x/usr/local/include/yara_x.h /usr/local/include/
61-
sudo cp -a /tmp/yara-x/usr/local/lib/x86_64-linux-gnu/* /usr/local/lib/
62-
sudo ldconfig -v
63-
cd ${{ github.workspace }}
64-
65-
- name: golangci-lint
66-
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
67-
with:
68-
version: v1.62.0
69-
args: --timeout=5m
39+
make golangci-lint-lint
7040
7141
- name: Unit tests
7242
run: |

.github/workflows/style.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,24 @@ jobs:
111111
check-latest: true
112112

113113
- uses: chainguard-dev/actions/goimports@9d943fc9889a0c0795e3c2bd4b949a9b610ac02e # main
114+
115+
golangci-lint:
116+
name: check golangci-lint
117+
runs-on: ubuntu-latest
118+
container: cgr.dev/chainguard/wolfi-base:latest
119+
steps:
120+
- name: Install dependencies
121+
run: |
122+
apk update
123+
apk add curl findutils git go nodejs xz yara-x-compat
124+
125+
- uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
126+
with:
127+
egress-policy: audit
128+
129+
- name: Checkout code
130+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
131+
132+
- name: Run golangci-lint
133+
run: |
134+
make golangci-lint-lint

0 commit comments

Comments
 (0)