Skip to content

Commit

Permalink
Demonstrate callable workflow methodology
Browse files Browse the repository at this point in the history
  • Loading branch information
coldav committed Oct 11, 2024
1 parent 5fbf4a7 commit 89cd96f
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 30 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup_ubuntu_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ runs:
# We don't want a new docker just a list of steps, so mark as composite
using: "composite"
steps:
- name: setup ubuntu inputs
shell: bash
run: |
echo llvm_build_type "${{ inputs.llvm_build_type }}"
echo llvm_version "${{ inputs.llvm_version }}"
echo ubuntu_version "${{ inputs.ubuntu_version }}"
echo llvm_build_type "${{ inputs.llvm_build_type }}"
echo save "${{ inputs.save }}"
echo arch "${{ inputs.arch }}"
- name: Install prerequisites
shell: bash
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
# pull_request:
# branches:
# - main
schedule:
- cron: '19 9 * * 3'

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Pull Request
on:
workflow_dispatch:
pull_request:
paths:
- source/**
- clik/**
- modules/**
- examples/**
- cmake/**
- hal/**
- .github/actions/do_build_ock/**
- .github/actions/setup_ubuntu_build/**
- .github/workflows/pull_request.yml
- CMakeLists.txt
# pull_request:
# paths:
# - source/**
# - clik/**
# - modules/**
# - examples/**
# - cmake/**
# - hal/**
# - .github/actions/do_build_ock/**
# - .github/actions/setup_ubuntu_build/**
# - .github/workflows/pull_request.yml
# - CMakeLists.txt
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
92 changes: 77 additions & 15 deletions .github/workflows/run_pr_tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
# 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_ubuntu_build/**'
- '.github/workflows/run_pr_tests.yml'
- 'CMakeLists.txt'
workflow_call:
inputs:
llvm_latest:
required: true
type: string
llvm_previous:
required: true
type: string
update_cache:
required: false
type: boolean
default: false
riscv_extra:
required: false
type: boolean
default: false

workflow_dispatch:
inputs:
llvm_latest:
required: true
type: string
# llvm_previous:
# required: true
# type: string
# update_cache:
# required: false
# default: false
# type: boolean
# riscv_extra:
# required: false
# type: boolean
# default: false

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -30,15 +51,23 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Declare inputs
run: |
echo llvm_latest = "${{ inputs.llvm_latest }}"
echo llvm_previous = "${{ inputs.llvm_previous }}"
echo update_cache = "${{ inputs.update_cache }}"
echo riscv_extra = "${{ inputs.riscv_extra }}"
- name: Checkout repo
uses: actions/checkout@v4

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
with:
llvm_version: 18
llvm_version: ${{ inputs.llvm_latest }}
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 @@ -72,7 +101,7 @@ jobs:
run_riscv_m1:

runs-on: ubuntu-22.04

if: ${{ inputs.riscv_extra }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -81,8 +110,9 @@ jobs:
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
with:
llvm_version: 18
llvm_version: ${{ inputs.llvm_latest }}
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 @@ -123,3 +153,35 @@ jobs:
fi
cat clang-format.diff
exit 1
############### JOB mr-ubuntu-gcc-x86_64-riscv-fp16-cl3-0-unitcl_vecz:

mr-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_ubuntu_build
with:
llvm_version: ${{ inputs.llvm_latest }}
llvm_build_type: RelAssert
save: ${{ inputs.update_cache }}

- 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
gtest_launcher: "/usr/bin/python;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
41 changes: 41 additions & 0 deletions .github/workflows/run_pr_tests_caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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_ubuntu_build/**'
- '.github/workflows/run_pr_tests.yml'
- 'CMakeLists.txt'
schedule:
- cron: '19 9 * * 3'

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:
llvm_latest: 18
llvm_previous: 17
update_cache: false
riscv_extra: 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:
llvm_latest: cron
llvm_previous: 17
update_cache: true
riscv_extra: true

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

0 comments on commit 89cd96f

Please sign in to comment.