Skip to content

Commit

Permalink
Add resusable workflow so we can run the PR testing in different ways
Browse files Browse the repository at this point in the history
We had duplicate ways of doing the same thing, this unifies the building
of the PR cache and the running of tests for PRs. This will be expanded
in the future to allow more flexibility.

Also brought pull_request.yml into the same file as run_pr_tests.yml
  • Loading branch information
coldav committed Oct 18, 2024
1 parent 0566643 commit 7a42a7a
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 123 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/build_pr_cache.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/pull_request.yml

This file was deleted.

57 changes: 44 additions & 13 deletions .github/workflows/run_pr_tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# Simple workflow for running non-documentation PR testing
name: Run ock tests for PR testing
on:
pull_request:
paths:
- 'source/**'
- 'clik/**'
- 'modules/**'
- 'examples/**'
- 'cmake/**'
- 'hal/**'
- '.github/actions/do_build_ock/**'
- '.github/actions/setup_build/**'
- '.github/workflows/run_pr_tests.yml'
- 'CMakeLists.txt'
workflow_call:
inputs:
update_cache:
required: false
type: boolean
default: false

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

inputs:
update_cache:
required: false
default: false
type: boolean

permissions: {}

concurrency:
Expand All @@ -39,6 +38,7 @@ jobs:
with:
llvm_version: 18
llvm_build_type: RelAssert
save: ${{ inputs.update_cache }}

# These need to match the configurations of build_pr_cache to use the cache effectively
- name: build host x86_64 online release
Expand Down Expand Up @@ -83,6 +83,7 @@ jobs:
with:
llvm_version: 18
llvm_build_type: RelAssert
save: ${{ inputs.update_cache }}

- name: build riscv M1
uses: ./.github/actions/do_build_ock/do_build_m1
Expand Down Expand Up @@ -117,6 +118,7 @@ jobs:
clang-format-diff.py -p1 -regex \
"^(?!(.+\\/)*(external|cookie)\\/).*\\.(c|cc|cxx|cpp|h|hh|hxx|hpp)$" -b clang-format
# Based on: mr-windows-msvc-x86_64-llvm-previous-cl3.0-offline
run_windows_msvc_x86_64_llvm_latest_cl3_0_offline:

runs-on: windows-2019
Expand Down Expand Up @@ -163,3 +165,32 @@ jobs:
build_dir: ${{ github.workspace }}/build_offline
c_compiler: 'cl.exe'
cxx_compiler: 'cl.exe'

# Based on: mr-ubuntu-gcc-x86_64-riscv-fp16-cl3.0-unitcl_vecz
run_ubuntu_gcc_x86_64_riscv_fp16_cl3_0_unitcl_vecz:
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: setup-ubuntu
uses: ./.github/actions/setup_build
with:
llvm_version: '18'
llvm_build_type: RelAssert
os: ubuntu
- run: echo WORKSPACE is $GITHUB_WORKSPACE && echo PWD is `pwd` && ls -al
- name: build ock
uses: ./.github/actions/do_build_ock
with:
build_targets: check-ock-UnitCL-group-vecz
mux_targets_enable: riscv
mux_compilers_enable: riscv
riscv_enabled: ON
enable_rvv_scalable_vecz_check: ON
enable_rvv_scalable_vp_vecz_check: ON
use_linker: gold
hal_description: RV64GCV_Zfh
hal_refsi_soc: G1
hal_refsi_thread_mode: WG
debug_support: ON
36 changes: 36 additions & 0 deletions .github/workflows/run_pr_tests_caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Calling workflow for running PR style tests
name: Run ock tests for PR style testing
on:
pull_request:
paths:
- 'source/**'
- 'clik/**'
- 'modules/**'
- 'examples/**'
- 'cmake/**'
- 'hal/**'
- '.github/actions/do_build_ock/**'
- '.github/actions/setup_build/**'
- '.github/workflows/run_pr_tests.yml'
- 'CMakeLists.txt'
schedule:
# Run Mon-Fri at 7pm
- cron: '00 19 * * 1-5'

jobs:
run-with-pull:
name: Call PR testing on pull request
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/run_pr_tests.yml
with:
update_cache: false

# Could have multiple here
run-with-cron:
name: Call PR testing on schedule
if: ${{ github.event_name == 'schedule' }}
uses: ./.github/workflows/run_pr_tests.yml
with:
update_cache: true

# additional ones here for cron and/or push to main - also can be in different file.

0 comments on commit 7a42a7a

Please sign in to comment.