feat(CI): skip matrix builds for non-C++ changes (#9008)

This commit is contained in:
Francesco Borzì
2021-11-07 10:11:13 +01:00
committed by GitHub
parent cb07d1fc8a
commit 7cd03f1429
5 changed files with 69 additions and 17 deletions

4
.github/labeler.yml vendored
View File

@@ -1,3 +1,7 @@
file-cpp:
- ./*.cpp
- ./*.h
DB:
- data/**/*.sql

View File

@@ -1,4 +1,4 @@
name: core-build
name: main
on:
push:
branches:
@@ -17,20 +17,6 @@ jobs:
# the result of the matrix will be the combination of all attributes, so we get os*compiler builds
os: [ubuntu-20.04]
compiler: [clang]
# we can include specific combinations here
include:
- os: ubuntu-20.04
compiler: clang12
- os: ubuntu-20.04
compiler: clang11
- os: ubuntu-18.04
compiler: clang10
- os: ubuntu-18.04
compiler: gcc8
- os: ubuntu-20.04
compiler: gcc # default in 20.04 is gcc 9
- os: ubuntu-20.04
compiler: gcc10
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.compiler }}
env:

62
.github/workflows/core_matrix_build.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: core
on:
push:
branches:
- 'master'
pull_request:
types: ['labeled']
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
# the result of the matrix will be the combination of all attributes, so we get os*compiler builds
include:
- os: ubuntu-20.04
compiler: clang12
- os: ubuntu-20.04
compiler: clang11
- os: ubuntu-18.04
compiler: clang10
- os: ubuntu-18.04
compiler: gcc8
- os: ubuntu-20.04
compiler: gcc # default in 20.04 is gcc 9
- os: ubuntu-20.04
compiler: gcc10
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.compiler }}
env:
COMPILER: ${{ matrix.compiler }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.event.label.name == 'run-build' || github.event.label.name == 'file-cpp' || github.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: var/ccache
key: ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ github.ref }}
ccache:${{ matrix.os }}:${{ matrix.compiler }}
- name: Configure OS
run: source ./acore.sh install-deps
env:
CONTINUOUS_INTEGRATION: true
- name: Create conf/config.sh
run: source ./apps/ci/ci-conf.sh
- name: Import db
run: source ./apps/ci/ci-import-db.sh
- name: Build
run: source ./apps/ci/ci-compile.sh
- name: Dry run
run: source ./apps/ci/ci-worldserver-dry-run.sh
- name: Check startup errors
run: source ./apps/ci/ci-error-check.sh
- name: Run unit tests
run: source ./apps/ci/ci-run-unit-tests.sh

View File

@@ -22,7 +22,7 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.modules }}-modules
env:
COMPILER: ${{ matrix.compiler }}
if: github.repository == 'azerothcore/azerothcore-wotlk'
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.event.label.name == 'file-cpp' || github.event.label.name == 'run-build' || github.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@v2
- name: Checkout modules

View File

@@ -16,7 +16,7 @@ jobs:
env:
COMPILER: clang
ENABLE_CPP_20: 1
if: github.repository == 'azerothcore/azerothcore-wotlk'
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.event.label.name == 'file-cpp' || github.event.label.name == 'run-build' || github.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@v2
- name: Cache