Skip to content

Commit

Permalink
Separe test actions
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Feb 13, 2024
1 parent 33e94f7 commit aca7b8d
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,3 @@ jobs:

- name: Lint
run: make go/lint

- name: Test
# Some of the GH action CI machines have several versions of Go installed.
# Make sometimes somehow resolves different Go. We need to specify explicitly.
run: make GO=`which go` test ENABLE_RACE=yes

- name: Integration tests
run: make GO=`which go` test/integration

- name: Test unwind tables
run: make test-dwarf-unwind-tables
82 changes: 82 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Integration Tests

on:
workflow_call:
workflow_run:
workflows: ["Test"]
types:
- completed

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
skip-check:
name: Skip check
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip-check.outputs.should_skip }}
permissions:
actions: write
contents: read
steps:
- id: skip-check
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
with:
do_not_skip: '["schedule", "workflow_dispatch"]'
paths: |-
[
"**_test.go",
".github/workflows/test.yml",
".go-version",
"3rdparty",
"Makefile",
"bpf/**",
"go.mod",
"go.sum",
"kerneltest/**",
"testdata/**",
"test/**"
]
skip_after_successful_duplicate: false

integration-tests:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ needs.skip-check.outputs.should_skip != 'true' }}
steps:
- name: Check out the code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: .go-version

- name: Set up Clang
uses: KyleMayes/install-llvm-action@be40c5af3a4adc3e4a03199995ab73aa37536712 # v1.9.0
with:
version: "14"

- name: Install libbpf dependencies
run: |
sudo apt-get update -y
sudo apt-get install -yq libelf-dev zlib1g-dev
- name: Install Go dependencies
run: make go/deps

- name: Build libbpf
run: make libbpf

- name: Build BPF
run: make bpf

- name: Cache Docker images for testcontainers
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}-${{ hashFiles('test/integration/*') }}

- name: Integration tests
run: make GO=`which go` test/integration
82 changes: 82 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test

on:
workflow_call:
workflow_run:
workflows: ["Build"]
types:
- completed

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
skip-check:
name: Skip check
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip-check.outputs.should_skip }}
permissions:
actions: write
contents: read
steps:
- id: skip-check
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
with:
do_not_skip: '["schedule", "workflow_dispatch"]'
paths: |-
[
"**_test.go",
".github/workflows/test.yml",
".go-version",
"3rdparty",
"Makefile",
"bpf/**",
"go.mod",
"go.sum",
"kerneltest/**",
"testdata/**",
"test/**"
]
skip_after_successful_duplicate: false

test:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ needs.skip-check.outputs.should_skip != 'true' }}
steps:
- name: Check out the code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: .go-version

- name: Set up Clang
uses: KyleMayes/install-llvm-action@be40c5af3a4adc3e4a03199995ab73aa37536712 # v1.9.0
with:
version: "14"

- name: Install libbpf dependencies
run: |
sudo apt-get update -y
sudo apt-get install -yq libelf-dev zlib1g-dev
- name: Install Go dependencies
run: make go/deps

- name: Build libbpf
run: make libbpf

- name: Build BPF
run: make bpf

- name: Run Tests
# Some of the GH action CI machines have several versions of Go installed.
# Make sometimes somehow resolves different Go. We need to specify explicitly.
run: make GO=`which go` test ENABLE_RACE=yes

- name: Run DWARF Unwind Table Tests
run: make test-dwarf-unwind-tables

0 comments on commit aca7b8d

Please sign in to comment.