mirror of https://github.com/PCSX2/pcsx2.git
126 lines
4.1 KiB
YAML
126 lines
4.1 KiB
YAML
name: Linux Build
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
# events but only for the master branch
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- .gitignore
|
|
- "**/*.md"
|
|
- .clang-format
|
|
- debian-packager/
|
|
- bin/PCSX2_keys.ini.default
|
|
- "plugins/LilyPad/**"
|
|
- .travis.yml # TODO - remove with travis-ci
|
|
- appveyor.yml # TODO - remove with appveyor
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- .gitignore
|
|
- "**/*.md"
|
|
- .clang-format
|
|
- debian-packager/
|
|
- bin/PCSX2_keys.ini.default
|
|
- "plugins/LilyPad/**"
|
|
- .travis.yml # TODO - remove with travis-ci
|
|
- appveyor.yml # TODO - remove with appveyor
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
# Prevent one build from failing everything (although maybe those should be included as experimental builds instead)
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-20.04
|
|
platform: x86
|
|
compiler: gcc
|
|
experimental: false
|
|
- os: ubuntu-20.04
|
|
platform: x64
|
|
compiler: gcc
|
|
experimental: false
|
|
- os: ubuntu-20.04
|
|
platform: x86
|
|
compiler: clang
|
|
# Need to disable PCH until cmake 3.17
|
|
# (PCH conflicts with ccache, fixed by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4400)
|
|
cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
|
|
detail: -nopch
|
|
experimental: false
|
|
- os: ubuntu-20.04
|
|
platform: x86
|
|
compiler: gcc
|
|
cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
|
|
detail: -nopch
|
|
experimental: false
|
|
|
|
name: ${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.compiler }}${{ matrix.detail }}
|
|
runs-on: ${{ matrix.os }}
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
# NOTE - useful for debugging
|
|
# - name: Dump GitHub context
|
|
# env:
|
|
# GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
# run: |
|
|
# echo "$GITHUB_CONTEXT"
|
|
# echo ${{ github.event.pull_request.title }}
|
|
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Cache Submodules
|
|
id: cache-submodules
|
|
uses: actions/cache@v2
|
|
with:
|
|
key: submodules-${{ hashFiles('./.gitmodules') }}
|
|
path: |
|
|
./.git/modules/
|
|
./3rdparty/fmt
|
|
./3rdparty/xz
|
|
./3rdparty/gtest
|
|
|
|
- name: Checkout Submodules
|
|
if: steps.cache-submodules.outputs.cache-hit != 'true'
|
|
run: git submodule update --init --recursive --jobs 2
|
|
|
|
# -- SETUP CCACHE - https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
|
|
- name: Prepare ccache timestamp
|
|
id: ccache_cache_timestamp
|
|
shell: cmake -P {0}
|
|
run: |
|
|
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
|
message("::set-output name=timestamp::${current_date}")
|
|
|
|
- name: ccache cache files
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: .ccache
|
|
key: ${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.compiler }}${{ matrix.detail }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
|
restore-keys: |
|
|
${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.compiler }}${{ matrix.detail }}-ccache-
|
|
|
|
- name: Install Packages
|
|
env:
|
|
PLATFORM: ${{ matrix.platform }}
|
|
COMPILER: ${{ matrix.compiler }}
|
|
run: ./.github/workflows/scripts/linux/install-packages.sh
|
|
|
|
- name: Generate CMake
|
|
env:
|
|
PLATFORM: ${{ matrix.platform }}
|
|
COMPILER: ${{ matrix.compiler }}
|
|
ADDITIONAL_CMAKE_ARGS: ${{ matrix.cmakeflags }}
|
|
run: ./.github/workflows/scripts/linux/generate-cmake.sh
|
|
|
|
- name: Build PCSX2
|
|
working-directory: ./build
|
|
run: ../.github/workflows/scripts/linux/compile.sh
|