Skip to content

Commit

Permalink
Clean up job names and conditions
Browse files Browse the repository at this point in the history
Windows will be run separately for the time being
  • Loading branch information
vadi2 committed May 9, 2024
1 parent f562812 commit 6f80596
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/build-mudlet.yml
Expand Up @@ -52,22 +52,21 @@ jobs:
submodules: true
fetch-depth: 0

- name: (Linux/macOS) Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v3
if: runner.os == 'Linux' || runner.os == 'macOS'
with:
version: ${{matrix.qt}}
dir: ${{runner.workspace}}
cache: true

- name: (Linux/macOS) Restore Boost cache
- name: Restore Boost cache
uses: actions/cache@v4
id: cache-boost
with:
path: ${{env.BOOST_ROOT}}
key: boost

- name: (Linux/macOS) Install Boost
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
if [ "$OS" == "Windows_NT" ]; then
Expand All @@ -83,7 +82,7 @@ jobs:
shell: bash

# workaround a poor interaction between github actions/cmake/vcpkg, see https://github.com/lukka/run-vcpkg/issues/88#issuecomment-885758902
- name: (Linux/macOS) Use CMake 3.20.1
- name: Use CMake 3.20.1
uses: lukka/get-cmake@v3.20.1

- name: (macOS) Install non-vcpkg dependencies (1/2)
Expand All @@ -103,7 +102,7 @@ jobs:
# gettext is needed for vcpkg
sudo apt-get install gettext -y
- name: (Linux/macOS) Restore from cache and run vcpkg
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v7
env:
vcpkgResponseFile: ${{github.workspace}}/3rdparty/our-vcpkg-dependencies/vcpkg-${{matrix.triplet}}-dependencies
Expand Down Expand Up @@ -202,7 +201,7 @@ jobs:
echo "WITH_3DMAPPER=no" >> $GITHUB_ENV
echo "WITH_FONTS=no" >> $GITHUB_ENV
- name: (Linux/macOS) restore ccache
- name: restore ccache
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/ccache
Expand All @@ -226,11 +225,10 @@ jobs:
# remove it as it breaks packaging down the line: https://github.com/Mudlet/Mudlet/issues/6668
brew uninstall pcre
- name: (Linux/macOS) check ccache stats prior to build
if: runner.os == 'Linux' || runner.os == 'macOS'
- name: check ccache stats prior to build
run: ccache --zero-stats --show-stats

- name: (Linux/macOS) Build Mudlet
- name: Build Mudlet
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
Expand All @@ -246,31 +244,29 @@ jobs:
env:
NINJA_STATUS: '[%f/%t %o/sec] '

- name: (Linux/macOS) Upload GitHub Actions artifact of vcpkg build logs
- name: Upload GitHub Actions artifact of vcpkg build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: vcpkg-logs-${{ runner.os }}
path: ${{ github.workspace }}/vcpkg/buildtrees/**/*.log

- name: (Linux/macOS) check ccache stats post build
if: runner.os == 'Linux' || runner.os == 'macOS'
- name: check ccache stats post build
run: ccache --show-stats

- name: (macOS) Run C++ tests
if: runner.os == 'macOS'
working-directory: '${{runner.workspace}}/b/ninja'
run: ctest --output-on-failure

- name: (Linux/macOS) restore Luarocks for packaging
- name: restore Luarocks for packaging
uses: actions/cache@v4
with:
path: $HOME/.luarocks
key: ccache-${{matrix.os}}-${{matrix.compiler}}-${{hashFiles('.github/workflows/build-mudlet.yml')}}
restore-keys: ccache-${{matrix.os}}-${{matrix.compiler}}-
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: (Linux/macOS) install dependencies for packaging/tests
- name: install dependencies for packaging/tests
if: matrix.deploy == 'deploy' || matrix.run_tests == 'true'
run: |
export PATH="${{env.VCPKG_ROOT}}/installed/${{matrix.triplet}}/tools/lua:$PATH"
Expand Down Expand Up @@ -304,13 +300,13 @@ jobs:
RUNNER_OS: ${{runner.os}}
DEPLOY: ${{matrix.deploy}}

- name: (Linux/macOS) add ssh-agent for tag deployment
- name: add ssh-agent for tag deployment
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.deploy == 'deploy' && startsWith(github.ref, 'refs/tags/Mudlet-')
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{secrets.UPLOAD_PRIVATEKEY}}

- name: (Linux/macOS) package Mudlet
- name: package Mudlet
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.deploy == 'deploy'
run: ${{github.workspace}}/CI/travis.after_success.sh
env:
Expand Down Expand Up @@ -373,11 +369,11 @@ jobs:
TESTS_DIRECTORY: ${{github.workspace}}/src/mudlet-lua/tests
QUIT_MUDLET_AFTER_TESTS: 'true'

- name: (Linux/macOS) Passed Lua tests
- name: Passed Lua tests
if: matrix.run_tests == 'true'
run: |
if [ -e /tmp/busted-tests-failed ]
then
echo "Lua tests failed - see the action above for detailed output."
exit 1
fi
fi

0 comments on commit 6f80596

Please sign in to comment.