CI: Improve and cleanup (#6448)
Chores: - Remove ci-ccache-maint. This has never been useful and is just cruft. - Remove then unused CI_COMMIT - Change job names so they come out nicer in the web views - Make os-name input to reusable-build always explicit Improvements: - Have at most build-test job in progress per branch - Cancel in-progress build-test jobs on PRs - In forks (that is, not on 'verilator/verilator'), cancel any in-progress build-test jobs on push to the branch
This commit is contained in:
parent
1432bb8889
commit
0e2f0381d0
|
|
@ -22,16 +22,18 @@ defaults:
|
||||||
working-directory: repo
|
working-directory: repo
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
|
# At most 1 job per branch. Auto cancel on pull requests and on all forks
|
||||||
cancel-in-progress: true
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'verilator/verilator' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-2404-gcc:
|
build-2404-gcc:
|
||||||
name: Build-Ubuntu
|
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
os-name: linux
|
||||||
cc: ${{ matrix.cc }}
|
cc: ${{ matrix.cc }}
|
||||||
asan: ${{ matrix.asan }}
|
asan: ${{ matrix.asan }}
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -41,10 +43,11 @@ jobs:
|
||||||
- {os: ubuntu-24.04, cc: gcc, asan: 0}
|
- {os: ubuntu-24.04, cc: gcc, asan: 0}
|
||||||
|
|
||||||
build-2404-clang:
|
build-2404-clang:
|
||||||
name: Build-Ubuntu
|
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
os-name: linux
|
||||||
cc: ${{ matrix.cc }}
|
cc: ${{ matrix.cc }}
|
||||||
asan: ${{ matrix.asan }}
|
asan: ${{ matrix.asan }}
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -54,10 +57,11 @@ jobs:
|
||||||
- {os: ubuntu-24.04, cc: clang, asan: 1}
|
- {os: ubuntu-24.04, cc: clang, asan: 1}
|
||||||
|
|
||||||
build-2204-gcc:
|
build-2204-gcc:
|
||||||
name: Build-Ubuntu
|
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
os-name: linux
|
||||||
cc: ${{ matrix.cc }}
|
cc: ${{ matrix.cc }}
|
||||||
asan: ${{ matrix.asan }}
|
asan: ${{ matrix.asan }}
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -67,10 +71,11 @@ jobs:
|
||||||
- {os: ubuntu-22.04, cc: gcc, asan: 0}
|
- {os: ubuntu-22.04, cc: gcc, asan: 0}
|
||||||
|
|
||||||
build-2204-clang:
|
build-2204-clang:
|
||||||
name: Build-Ubuntu
|
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
os-name: linux
|
||||||
cc: ${{ matrix.cc }}
|
cc: ${{ matrix.cc }}
|
||||||
asan: ${{ matrix.asan }}
|
asan: ${{ matrix.asan }}
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -80,7 +85,7 @@ jobs:
|
||||||
- {os: ubuntu-22.04, cc: clang, asan: 0}
|
- {os: ubuntu-22.04, cc: clang, asan: 0}
|
||||||
|
|
||||||
build-osx-gcc:
|
build-osx-gcc:
|
||||||
name: Build-OSX
|
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
|
@ -94,7 +99,7 @@ jobs:
|
||||||
- {os: macos-15, cc: gcc, asan: 0}
|
- {os: macos-15, cc: gcc, asan: 0}
|
||||||
|
|
||||||
build-osx-clang:
|
build-osx-clang:
|
||||||
name: Build-OSX
|
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
|
@ -108,7 +113,7 @@ jobs:
|
||||||
- {os: macos-15, cc: clang, asan: 0}
|
- {os: macos-15, cc: clang, asan: 0}
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
name: Build-Windows
|
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
@ -117,7 +122,6 @@ jobs:
|
||||||
- {os: windows-2025, cc: msvc}
|
- {os: windows-2025, cc: msvc}
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: win
|
CI_OS_NAME: win
|
||||||
CI_COMMIT: ${{ github.sha }}
|
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
|
|
@ -145,7 +149,7 @@ jobs:
|
||||||
name: verilator-win.zip
|
name: verilator-win.zip
|
||||||
|
|
||||||
test-2404-gcc:
|
test-2404-gcc:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
||||||
needs: build-2404-gcc
|
needs: build-2404-gcc
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
@ -167,7 +171,7 @@ jobs:
|
||||||
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
||||||
|
|
||||||
test-2404-clang:
|
test-2404-clang:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
||||||
needs: build-2404-clang
|
needs: build-2404-clang
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
@ -189,7 +193,7 @@ jobs:
|
||||||
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: vltmt-2}
|
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: vltmt-2}
|
||||||
|
|
||||||
test-2204-gcc:
|
test-2204-gcc:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
||||||
needs: build-2204-gcc
|
needs: build-2204-gcc
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
@ -211,7 +215,7 @@ jobs:
|
||||||
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
||||||
|
|
||||||
test-2204-clang:
|
test-2204-clang:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
||||||
needs: build-2204-clang
|
needs: build-2204-clang
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ permissions:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: linux
|
CI_OS_NAME: linux
|
||||||
CI_COMMIT: ${{ github.sha }}
|
|
||||||
COVERAGE: 1
|
COVERAGE: 1
|
||||||
VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz
|
VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- 'dependabot/**' # Avoid duplicates: only run the PR, not the push
|
- 'dependabot/**' # Avoid duplicates: only run the PR, not the push
|
||||||
pull_request_target:
|
|
||||||
workflow_dispatch:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
jobs:
|
jobs:
|
||||||
format:
|
format:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,18 @@ on:
|
||||||
os: # e.g. ubuntu-24.04
|
os: # e.g. ubuntu-24.04
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
cc: # gcc or clang
|
cc: # 'clang' or 'gcc'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
os-name:
|
os-name: # 'linux' or 'osx'
|
||||||
required: false
|
required: true
|
||||||
type: string
|
type: string
|
||||||
default: linux
|
|
||||||
asan:
|
asan:
|
||||||
required: true
|
required: true
|
||||||
type: number
|
type: number
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: ${{ inputs.os-name }}
|
CI_OS_NAME: ${{ inputs.os-name }}
|
||||||
CI_COMMIT: ${{ github.sha }}
|
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
|
|
@ -39,7 +37,7 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ inputs.os }}
|
runs-on: ${{ inputs.os }}
|
||||||
name: Sub-build | ${{ inputs.os }} | ${{ inputs.cc }}
|
name: Build
|
||||||
env:
|
env:
|
||||||
CI_ASAN: ${{ inputs.asan }}
|
CI_ASAN: ${{ inputs.asan }}
|
||||||
CI_BUILD_STAGE_NAME: build
|
CI_BUILD_STAGE_NAME: build
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: linux
|
CI_OS_NAME: linux
|
||||||
CI_COMMIT: ${{ github.sha }}
|
|
||||||
CI_BUILD_STAGE_NAME: build
|
CI_BUILD_STAGE_NAME: build
|
||||||
CI_RUNS_ON: ubuntu-22.04
|
CI_RUNS_ON: ubuntu-22.04
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: linux
|
CI_OS_NAME: linux
|
||||||
CI_COMMIT: ${{ github.sha }}
|
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
|
|
@ -38,7 +37,7 @@ jobs:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ inputs.os }}
|
runs-on: ${{ inputs.os }}
|
||||||
name: Sub-test | ${{ inputs.os }} | ${{ inputs.cc }} | ${{inputs.reloc && 'reloc | ' || '' }} ${{ inputs.suite }}
|
name: Test
|
||||||
env:
|
env:
|
||||||
CI_BUILD_STAGE_NAME: test
|
CI_BUILD_STAGE_NAME: test
|
||||||
CI_RUNS_ON: ${{ inputs.os }}
|
CI_RUNS_ON: ${{ inputs.os }}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ defaults:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.ref }}
|
# At most 1 job per branch. Auto cancel all but scheduled jobs
|
||||||
|
group: ${{ github.worfklow }}-${{ github.ref }}
|
||||||
cancel-in-progress: ${{ github.event_name != 'schedule' }}
|
cancel-in-progress: ${{ github.event_name != 'schedule' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# DESCRIPTION: Verilator: CI ccache maintenance
|
|
||||||
#
|
|
||||||
# Copyright 2020 by Geza Lore. This program is free software; you
|
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
|
||||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
||||||
# Version 2.0.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# This script is run in 'before_script', once ccache has been set up.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# Show version
|
|
||||||
ccache --version
|
|
||||||
|
|
||||||
# Flush ccache if requested in commit message
|
|
||||||
COMMIT="${CI_PULL_REQUEST_SHA:-$CI_COMMIT}"
|
|
||||||
if git log --format=%B -n 1 "$COMMIT" | grep -q -i '\[CI\s\+ccache\s\+clear\]'; then
|
|
||||||
echo "Flushing ccache due to commit message"
|
|
||||||
ccache -C
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Dump stats, then zero stats
|
|
||||||
# 22.04: ccache -s -v -z
|
|
||||||
ccache -s -z
|
|
||||||
|
|
@ -85,7 +85,7 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$CCACHE_DIR" ]; then
|
if [ -n "$CCACHE_DIR" ]; then
|
||||||
mkdir -p "$CCACHE_DIR" && ./ci/ci-ccache-maint.bash
|
mkdir -p "$CCACHE_DIR"
|
||||||
fi
|
fi
|
||||||
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue