Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from azure to github actions #1747

Merged
merged 19 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: ubuntu CI
on:
push:
branches-ignore:
- 'dependabot**'
tags:
- '*'
paths-ignore:
- '**/lsan.supp'
- 'buildScripts/travis/*'
- 'buildScripts/azure/*'
- 'buildScripts/docker/*'
- 'azure-pipelines.yml'
- '.cirrus.yml'
- '.travis.yml'
- '.mergify.yml'
- 'Brewfile'
- '**/*.html'
- '**/*.txt'
- '**/*.md'
- 'installer/packages/**/meta/prebuild-mac.sh'
- 'installer/packages/**/meta/prebuild-linux-gnu.sh'
- '**/*.dockerfile'
- '**/*.Dockerfile'
- '**/Dockerfile'
- '**/Dockerfile.*'
- 'plugins/robots/checker/scripts/build-checker-installer.sh'
- '.github/workflows/centos.yml'
pull_request:
branches-ignore:
- 'dependabot**'
workflow_dispatch:

jobs:
lint:
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
lint: true
build: false
build_installer: false

build-ubuntu-release-ccache:
needs: lint
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
build: true
build_installer: false
qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
tests: true

build-ubuntu-debug-ccache:
needs: lint
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
build: true
build_installer: false
config: debug
qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"
tests: true

build-ubuntu-release-tests:
needs: build-ubuntu-release-ccache
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
build: true
build_installer: false
qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"

build-ubuntu-debug-tests:
needs: build-ubuntu-debug-ccache
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
build: true
build_installer: false
config: debug
qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"

build-ubuntu-installer:
needs: [build-ubuntu-debug-tests, build-ubuntu-release-tests]
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
build: true
build_installer: true
qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
tests: true
96 changes: 96 additions & 0 deletions .github/workflows/macos_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: macOS CI
on:
push:
branches-ignore:
- 'dependabot**'
tags:
- '*'
paths-ignore:
- '**/lsan.supp'
- 'buildScripts/travis/*'
- 'buildScripts/azure/*'
- 'buildScripts/docker/*'
- 'azure-pipelines.yml'
- '.cirrus.yml'
- '.travis.yml'
- '.mergify.yml'
- 'Brewfile'
- '**/*.html'
- '**/*.txt'
- '**/*.md'
- 'installer/packages/**/meta/prebuild-mac.sh'
- 'installer/packages/**/meta/prebuild-linux-gnu.sh'
- '**/*.dockerfile'
- '**/*.Dockerfile'
- '**/Dockerfile'
- '**/Dockerfile.*'
- 'plugins/robots/checker/scripts/build-checker-installer.sh'
- '.github/workflows/centos.yml'
pull_request:
branches-ignore:
- 'dependabot**'
workflow_dispatch:

jobs:
lint:
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
lint: true
build: false
build_installer: false

build-macos-release-ccache:
needs: lint
uses: ./.github/workflows/setup_environment.yml
with:
os: macos-12
executor: "time"
build: true
build_installer: false
qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
tests: true

build-macos-debug-ccache:
needs: lint
uses: ./.github/workflows/setup_environment.yml
with:
os: macos-12
executor: "time"
build: true
build_installer: false
config: debug
qmake_extra: "CONFIG+=warn_off CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"
tests: true

build-macos-release-tests:
needs: build-macos-release-ccache
uses: ./.github/workflows/setup_environment.yml
with:
os: macos-12
executor: "time"
build: true
build_installer: false
qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"

build-macos-debug-tests:
needs: build-macos-debug-ccache
uses: ./.github/workflows/setup_environment.yml
with:
os: macos-12
executor: "time"
build: true
build_installer: false
config: debug
qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"

build-macos-installer:
needs: [build-macos-debug-tests, build-macos-release-tests]
uses: ./.github/workflows/setup_environment.yml
with:
os: macos-12
executor: "time"
build: true
build_installer: true
qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
tests: true
8 changes: 8 additions & 0 deletions .github/workflows/rockylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ on:
workflow_dispatch:

jobs:
lint:
uses: ./.github/workflows/setup_environment.yml
with:
os: ubuntu-latest
lint: true
build: false
build_installer: false
build:
needs: lint
runs-on: ubuntu-latest
container: rockylinux:9
defaults:
Expand Down
142 changes: 142 additions & 0 deletions .github/workflows/setup_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Set up Action

on:
workflow_call:
inputs:
os:
required: true
type: string
executor:
required: false
type: string
default: "time docker exec -i builder"
lint:
required: false
type: string
default: 'false'
build:
required: true
type: string
build_installer:
required: true
type: string
trik-qt-version:
required: false
type: string
default: '5.12'
trik-python3-version-minor:
required: false
type: string
default: '9'
qtifw-version:
required: false
type: string
default: '4.6.1'
xcode-version:
required: false
type: string
default: '13.4'
config:
required: false
type: string
default: 'release'
qmake_extra:
required: false
type: string
default: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache"
tests:
required: false
type: string
default: "./run-simulator-tests.sh"

jobs:
job:
defaults:
run:
shell: bash

runs-on: ${{ inputs.os }}
steps:
- name: Cancel Previous Workflow Runs
uses: n1hility/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure git
run: |
git config --global core.symlinks true
git config --global core.autocrlf input

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up environment
run: buildScripts/github/install_${{ runner.os }}.sh
env:
TRIK_QT_VERSION: ${{ inputs.trik-qt-version }}
TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }}
QTIFW_VERSION: ${{ inputs.qtifw-version }}
XCODE_VERSION: ${{ inputs.xcode-version }}

- name: Lint
run: ${{ inputs.executor }} buildScripts/github/vera_translation.sh
if: ${{ inputs.lint == 'true' }}

- name: Restore cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }}
key: ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}-${{ github.sha }}
restore-keys: |
ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}-
ccache-${{ inputs.os }}-${{ inputs.config }}-
ccache-${{ inputs.os }}-
if: ${{ inputs.build == 'true' }}

- name: Build
run: buildScripts/github/build.sh
env:
TRIK_QT_VERSION: ${{ inputs.trik-qt-version }}
TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }}
CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }}
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf
PROJECT: "studio"
CONFIG: ${{ inputs.config }}
EXECUTOR: ${{ inputs.executor }}
QMAKE_EXTRA: ${{ inputs.qmake_extra }}
TESTS: ${{ inputs.tests }}
if: ${{ inputs.build == 'true' }}

- name: Build Installer
run: |
BRANCH_NAME=${BRANCH_NAME//\//-}
${{ inputs.executor }} env CONFIG=${{ inputs.config }} buildScripts/github/test.sh && buildScripts/github/build_installer.sh
env:
TRIK_QT_VERSION: ${{ inputs.trik-qt-version }}
TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }}
CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }}
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf
PROJECT: "studio"
CONFIG: ${{ inputs.config }}
EXECUTOR: ${{ inputs.executor }}
QMAKE_EXTRA: ${{ inputs.qmake_extra }}
TESTS: ${{ inputs.tests }}
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
PULLREQUESTNUMBER: ${{ github.event.pull_request.number }}
password: ${{ secrets.password }}
server: ${{ secrets.server }}
if: ${{ inputs.build_installer == 'true' }}

- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-installer
path: |
installer/*.exe
installer/*.run
installer/*.dmg
if: ${{ inputs.build_installer == 'true' }}

42 changes: 42 additions & 0 deletions buildScripts/github/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
set -uxeo pipefail

CODECOV=true
case $RUNNER_OS in
macOS)
QT_DIR=$(ls -dv "$HOME"/Qt/${TRIK_QT_VERSION}*/*/bin | head -n 1)
[ -d "$QT_DIR" ] && export PATH="$QT_DIR:$PATH"
export PATH="/usr/local/opt/ccache/libexec:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
echo "Now path is $PATH"
;;
Linux)
;;
*) exit 1 ;;
esac

mkdir -p $CCACHE_DIR || sudo chown -R $USER $CCACHE_DIR || :
cat << EOF > $CCACHE_CONFIGPATH
compiler_check=content
run_second_cpp=true
cache_dir=$CCACHE_DIR
compression=true
compression_level=1
sloppiness=time_macros,pch_defines,include_file_ctime,include_file_mtime,file_stat_matches
max_size=1200M
EOF

$EXECUTOR env \
CCACHE_CONFIGPATH="$CCACHE_CONFIGPATH" \
CCACHE_DIR="$CCACHE_DIR" \
CONFIG="$CONFIG" \
QMAKE_EXTRA="$QMAKE_EXTRA" \
PROJECT="$PROJECT" \
RUNNER_OS="$RUNNER_OS" \
TESTS="$TESTS" \
buildScripts/github/build_internal.sh


df -h .

$CODECOV
Loading
Loading