[CI] Refactoring

This commit is contained in:
Mat Sutcliffe
2020-06-16 21:49:16 +01:00
parent 2b4f10a96d
commit 4a9e222733
2 changed files with 42 additions and 51 deletions

View File

@@ -15,24 +15,32 @@ env:
jobs:
preBuild:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.version.outputs.value }}
steps:
- name: Remove artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: xswiftbus-thin-allos-${{ github.run_id }}
failOnError: false
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Get version number
id: version
run: |
pip3 install tee
echo "::set-output name=value::$(python3 -u scripts/build.py --version)"
- name: Run cppcheck
run: |
sudo apt install cppcheck
cppcheck --template=gcc --inline-suppr --std=c++14 --enable=style,unusedFunction -i externals \
--suppressions-list=cppcheck.supp --library=qt.cfg --library=posix.cfg . | tee error.log
ls -l error.log
- name: Remove artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: xswiftbus-thin-allos-${{ steps.version.outputs.value }}
failOnError: false
buildLinux:
runs-on: ubuntu-16.04
@@ -76,25 +84,21 @@ jobs:
env:
VATSIM_ID: ${{ secrets.VATSIM_ID }}
VATSIM_KEY: ${{ secrets.VATSIM_KEY }}
- name: Get version number
run: |
SWIFT_VERSION=$(ls swiftinstaller-* | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
echo "::set-env name=swift_version::$SWIFT_VERSION"
- name: Upload installer
uses: actions/upload-artifact@v2
with:
name: swiftinstaller-linux-64-${{ env.swift_version }}
name: swiftinstaller-linux-64-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftinstaller-*
- name: Upload symbols
uses: actions/upload-artifact@v2
if: ${{ env.do_symbols }}
with:
name: swiftsymbols-allos-${{ env.swift_version }}
name: swiftsymbols-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftsymbols-*
- name: Upload xswiftbus
uses: actions/upload-artifact@v2
with:
name: xswiftbus-thin-allos-${{ github.run_id }}
name: xswiftbus-thin-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/xswiftbus-*
buildWin64:
@@ -110,7 +114,7 @@ jobs:
version: 5.15.0
arch: "win64_msvc2019_64"
aqtversion: ">=0.9.0"
- name: Install InstallBuilder
- name: Download InstallBuilder
run: |
curl.exe --output "$HOME\installbuilder.exe" -L --url https://installbuilder.com/installbuilder-qt-professional-20.4.0-windows-x64-installer.exe
start -wait "$HOME\installbuilder.exe" @("--mode", "unattended", "--prefix", "$HOME\installbuilder")
@@ -139,26 +143,21 @@ jobs:
env:
VATSIM_ID: ${{ secrets.VATSIM_ID }}
VATSIM_KEY: ${{ secrets.VATSIM_KEY }}
- name: Get version number
shell: bash
run: |
SWIFT_VERSION=$(ls swiftinstaller-* | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
echo "::set-env name=swift_version::$SWIFT_VERSION"
- name: Upload installer
uses: actions/upload-artifact@v2
with:
name: swiftinstaller-windows-64-${{ env.swift_version }}
name: swiftinstaller-windows-64-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftinstaller-*
- name: Upload symbols
uses: actions/upload-artifact@v2
if: ${{ env.do_symbols }}
with:
name: swiftsymbols-allos-${{ env.swift_version }}
name: swiftsymbols-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftsymbols-*
- name: Upload xswiftbus
uses: actions/upload-artifact@v2
with:
name: xswiftbus-thin-allos-${{ github.run_id }}
name: xswiftbus-thin-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/xswiftbus-*
buildWin32:
@@ -174,7 +173,7 @@ jobs:
version: 5.15.0
arch: "win32_msvc2019"
aqtversion: ">=0.9.0"
- name: Install InstallBuilder
- name: Download InstallBuilder
run: |
curl.exe --output "$HOME\installbuilder.exe" -L --url https://installbuilder.com/installbuilder-qt-professional-20.4.0-windows-installer.exe
start -wait "$HOME\installbuilder.exe" @("--mode", "unattended", "--prefix", "$HOME\installbuilder")
@@ -203,26 +202,21 @@ jobs:
env:
VATSIM_ID: ${{ secrets.VATSIM_ID }}
VATSIM_KEY: ${{ secrets.VATSIM_KEY }}
- name: Get version number
shell: bash
run: |
SWIFT_VERSION=$(ls swiftinstaller-* | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
echo "::set-env name=swift_version::$SWIFT_VERSION"
- name: Upload installer
uses: actions/upload-artifact@v2
with:
name: swiftinstaller-windows-32-${{ env.swift_version }}
name: swiftinstaller-windows-32-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftinstaller-*
- name: Upload symbols
uses: actions/upload-artifact@v2
if: ${{ env.do_symbols }}
with:
name: swiftsymbols-allos-${{ env.swift_version }}
name: swiftsymbols-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftsymbols-*
- name: Upload xswiftbus
uses: actions/upload-artifact@v2
with:
name: xswiftbus-thin-allos-${{ github.run_id }}
name: xswiftbus-thin-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/xswiftbus-*
buildMacOS:
@@ -272,57 +266,51 @@ jobs:
env:
VATSIM_ID: ${{ secrets.VATSIM_ID }}
VATSIM_KEY: ${{ secrets.VATSIM_KEY }}
- name: Get version number
run: |
SWIFT_VERSION=$(ls swiftinstaller-* | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
echo "::set-env name=swift_version::$SWIFT_VERSION"
- name: Upload installer
uses: actions/upload-artifact@v2
with:
name: swiftinstaller-macos-64-${{ env.swift_version }}
name: swiftinstaller-macos-64-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftinstaller-*
- name: Upload symbols
uses: actions/upload-artifact@v2
if: ${{ env.do_symbols }}
with:
name: swiftsymbols-allos-${{ env.swift_version }}
name: swiftsymbols-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/swiftsymbols-*
- name: Upload xswiftbus
uses: actions/upload-artifact@v2
with:
name: xswiftbus-thin-allos-${{ github.run_id }}
name: xswiftbus-thin-allos-${{ needs.preBuild.outputs.version }}
path: ${{ github.workspace }}/xswiftbus-*
postBuild:
runs-on: ubuntu-latest
needs: [buildLinux, buildWin64, buildWin32, buildMacOS]
runs-on: ubuntu-20.04
needs: [preBuild, buildLinux, buildWin64, buildWin32, buildMacOS]
steps:
- name: Download xswiftbus-thin
uses: actions/download-artifact@v2
with:
name: xswiftbus-thin-allos-${{ github.run_id }}
name: xswiftbus-thin-allos-${{ needs.preBuild.outputs.version }}
- name: Repackage xswiftbus
run: |
7z x -y xswiftbus-windows-32-*.7z
7z x -y xswiftbus-windows-64-*.7z
7z x -y xswiftbus-linux-64-*.7z
7z x -y xswiftbus-macos-64-*.7z
SWIFT_VERSION=$(ls xswiftbus-windows-32-*.7z | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
echo "::set-env name=swift_version::$SWIFT_VERSION"
7z a -y -mx=9 xswiftbus-fat-allos-${SWIFT_VERSION}.7z xswiftbus
7z a -y -mx=9 xswiftbus-fat-allos-${{ needs.preBuild.outputs.version }}.7z xswiftbus
- name: Upload xswiftbus-fat
uses: actions/upload-artifact@v2
with:
name: xswiftbus-fat-allos-${{ env.swift_version }}
name: xswiftbus-fat-allos-${{ needs.preBuild.outputs.version }}
path: xswiftbus-fat-allos-*
- name: Remove xswiftbus-thin
uses: geekyeggo/delete-artifact@v1
with:
name: xswiftbus-thin-allos-${{ github.run_id }}
name: xswiftbus-thin-allos-${{ needs.preBuild.outputs.version }}
notify:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [preBuild, buildLinux, buildWin64, buildWin32, buildMacOS, postBuild]
if: always()