2022-05-14 05:56:57 +00:00
|
|
|
name: Linux Build Steps
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
jobName:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
os:
|
|
|
|
required: false
|
|
|
|
type: string
|
2022-07-02 04:00:56 +00:00
|
|
|
default: ubuntu-20.04
|
2022-05-14 05:56:57 +00:00
|
|
|
platform:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: x64
|
|
|
|
compiler:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
cmakeflags:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
buildAppImage:
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
detail:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: ""
|
2022-08-04 19:33:37 +00:00
|
|
|
cheats_url:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: https://github.com/PCSX2/pcsx2_patches/releases/latest/download
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_linux:
|
|
|
|
name: ${{ inputs.jobName }}
|
|
|
|
runs-on: ${{ inputs.os }}
|
|
|
|
# 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: 60
|
|
|
|
env:
|
|
|
|
CCACHE_BASEDIR: ${{ github.workspace }}
|
|
|
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
|
|
|
CCACHE_COMPRESS: true
|
|
|
|
CCACHE_COMPRESSLEVEL: 9
|
|
|
|
CCACHE_MAXSIZE: 100M
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Prepare Artifact Metadata
|
|
|
|
id: artifact-metadata
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
OS: linux
|
2022-07-02 04:00:56 +00:00
|
|
|
GUI_FRAMEWORK: QT
|
2022-05-14 05:56:57 +00:00
|
|
|
ARCH: ${{ inputs.platform }}
|
|
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
|
|
PR_NUM: ${{ github.event.pull_request.number }}
|
|
|
|
PR_SHA: ${{ github.event.pull_request.head.sha }}
|
|
|
|
run: ./.github/workflows/scripts/common/name-artifacts.sh
|
|
|
|
|
|
|
|
# -- SETUP CCACHE - https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
|
|
|
|
- name: Prepare ccache timestamp
|
|
|
|
id: ccache_cache_timestamp
|
2022-10-19 21:49:51 +00:00
|
|
|
run: echo "timestamp=$(date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
- name: ccache cache files
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: .ccache
|
2022-12-03 22:08:05 +00:00
|
|
|
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.detail }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
|
|
|
restore-keys: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.detail }} ccache
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
- name: Install Packages
|
|
|
|
env:
|
|
|
|
COMPILER: ${{ inputs.compiler }}
|
2022-07-02 04:00:56 +00:00
|
|
|
run: .github/workflows/scripts/linux/install-packages-qt.sh
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
- name: Cache Dependencies
|
2022-07-02 04:00:56 +00:00
|
|
|
id: cache-deps
|
2022-05-14 05:56:57 +00:00
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
2022-07-02 04:00:56 +00:00
|
|
|
path: ~/deps
|
|
|
|
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.gui }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh') }}
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
- name: Build Dependencies
|
2022-07-02 04:00:56 +00:00
|
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
|
|
run: .github/workflows/scripts/linux/build-dependencies-qt.sh
|
2022-05-14 05:56:57 +00:00
|
|
|
|
2022-08-04 19:33:37 +00:00
|
|
|
- name: Download cheats
|
|
|
|
run: |
|
|
|
|
cd bin/resources
|
|
|
|
aria2c -Z "${{ inputs.cheats_url }}/cheats_ni.zip" "${{ inputs.cheats_url }}/cheats_ws.zip"
|
|
|
|
|
2022-05-14 05:56:57 +00:00
|
|
|
- name: Generate CMake
|
|
|
|
env:
|
|
|
|
COMPILER: ${{ inputs.compiler }}
|
|
|
|
ADDITIONAL_CMAKE_ARGS: ${{ inputs.cmakeflags }}
|
2022-07-02 04:00:56 +00:00
|
|
|
run: .github/workflows/scripts/linux/generate-cmake-qt.sh
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
- name: Build PCSX2
|
|
|
|
working-directory: build
|
|
|
|
run: ../.github/workflows/scripts/linux/compile.sh
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
working-directory: ./build
|
|
|
|
run: ninja unittests
|
|
|
|
|
|
|
|
- name: Package AppImage
|
|
|
|
if: inputs.buildAppImage == true
|
|
|
|
env:
|
2022-07-02 04:00:56 +00:00
|
|
|
NAME: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
|
|
|
run: |
|
2023-01-02 03:13:12 +00:00
|
|
|
.github/workflows/scripts/linux/appimage-qt.sh "$(realpath .)" "$(realpath ./build)" "$HOME/deps" "$NAME"
|
2022-07-02 04:00:56 +00:00
|
|
|
mkdir -p "$GITHUB_WORKSPACE"/ci-artifacts/
|
|
|
|
mv "${NAME}.AppImage" "$GITHUB_WORKSPACE"/ci-artifacts/
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
if: inputs.buildAppImage == true
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
|
|
|
path: ci-artifacts
|