Skip to content

Commit

Permalink
[CI]: Improve install-premake5/action.yml to install premake in syste…
Browse files Browse the repository at this point in the history
…m directory
  • Loading branch information
Jarod42 committed Jul 18, 2024
1 parent 22fb76e commit 2400b3e
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 89 deletions.
22 changes: 14 additions & 8 deletions .github/actions/install-premake5/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,37 @@ runs:
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
path: premake-build
path: .premake-build

- name: Build premake5
if: runner.os == 'Linux'
run: |
cd premake-build
cd .premake-build
make -f Bootstrap.mak linux CONFIG=release
cp bin/release/premake5 ../
sudo cp bin/release/premake5 /usr/bin/
cd ..
rm -Rf premake-build
rm -Rf .premake-build
shell: bash

- name: Build premake5
if: runner.os == 'macOS'
run: |
cd premake-build
cd .premake-build
make -f Bootstrap.mak osx CONFIG=release
cp bin/release/premake5 ../
mkdir /Applications/premake5.app
cp bin/release/premake5 /Applications/premake5.app/
cd ..
rm -Rf premake-build
rm -Rf .premake-build
echo PATH=$PATH:/Applications/premake5.app/ >> $GITHUB_ENV
echo /Applications/premake5.app/ >> GITHUB_PATH
shell: bash

- name: Build premake5
if: runner.os == 'Windows' # 2019 or 2022
run: |
mkdir "C:\Program Files\premake"
$vcvarall_path = vswhere -find VC\Auxiliary\Build\vcvarsall.bat
cmd.exe /c "call ""$vcvarall_path"" x86_amd64 && cd premake-build && nmake -f Bootstrap.mak MSDEV=${{ inputs.msdev }} windows-msbuild PLATFORM=Win32 CONFIG=release && cp bin/release/premake5.exe ../"
cmd.exe /c "call ""$vcvarall_path"" x86_amd64 && cd .premake-build && nmake -f Bootstrap.mak MSDEV=${{ inputs.msdev }} windows-msbuild PLATFORM=Win32 CONFIG=release && cp bin/release/premake5.exe ""c:/Program Files/premake"""
Remove-Item .premake-build -Recurse -Force
echo "C:\Program Files\premake" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell
6 changes: 3 additions & 3 deletions .github/workflows/premake5-mac-xcode4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
repository: premake/premake-core

- name: test projects default(clang)
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects xcode4
run: python3 ./test_projects.py premake5 projects xcode4

- name: test projects gcc
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects xcode4 --cc=gcc
run: python3 ./test_projects.py premake5 projects xcode4 --cc=gcc

- name: test projects clang
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects xcode4 --cc=clang
run: python3 ./test_projects.py premake5 projects xcode4 --cc=clang
11 changes: 4 additions & 7 deletions .github/workflows/premake5-qt-mac-xcode4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,25 @@ jobs:
cache: true
cache-key-prefix: 'qt-action@4-Qt${{matrix.qt-version}}_macos'

- name: set path
- name: set environment variable
run: |
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
find $QT_ROOT_DIR -name "*moc*"
#- name: install libxkbcommon-x11-0 # display dependency
# run: sudo apt-get install libxkbcommon-x11-0

- name: test projects default(clang)
run: |
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-version }}
python3 ./test_projects.py premake5 projects-qt xcode4 --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
- name: test projects gcc
run: |
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-version }} --cc=gcc
python3 ./test_projects.py premake5 projects-qt xcode4 --scripts=`pwd` --qt-version=${{ matrix.qt-version }} --cc=gcc
- name: test projects clang
run: |
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
python3 ./test_projects.py premake5 projects-qt xcode4 --qt-version=${{ matrix.qt-version }} --cc=clang
python3 ./test_projects.py premake5 projects-qt xcode4 --scripts=`pwd` --qt-version=${{ matrix.qt-version }} --cc=clang
6 changes: 2 additions & 4 deletions .github/workflows/premake5-qt-ubuntu-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ jobs:
cache: true
cache-key-prefix: 'qt-action@v4-Qt${{matrix.qt-version}}_ubuntu'

- name: set path
- name: set environment variable
run: |
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
#--qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
Expand All @@ -77,4 +75,4 @@ jobs:
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
xvfb-run -a python3 ./test_projects.py premake5 projects-qt cmake --qt-version=${{ matrix.qt-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt cmake --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
7 changes: 2 additions & 5 deletions .github/workflows/premake5-qt-ubuntu-codeblocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,8 @@ jobs:
mkdir -p ~/.config/codeblocks
cp codeblocks/default.conf ~/.config/codeblocks/
- name: set path
- name: set environment variable
run: |
echo `pwd` >> $GITHUB_PATH
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
Expand All @@ -88,4 +85,4 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
#--qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codeblocks --qt-version=${{ matrix.qt-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codeblocks --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
7 changes: 2 additions & 5 deletions .github/workflows/premake5-qt-ubuntu-codelite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ jobs:
cache: true
cache-key-prefix: 'qt-action@v4-Qt${{matrix.qt-version}}_ubuntu'

- name: set path
- name: set environment variable
run: |
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
Expand All @@ -81,5 +79,4 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
# --qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codelite --qt-version=${{ matrix.qt-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt codelite --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
6 changes: 2 additions & 4 deletions .github/workflows/premake5-qt-ubuntu-gmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ jobs:
cache: true
cache-key-prefix: 'qt-action@v4-Qt${{matrix.qt-version}}_ubuntu'

- name: set path
- name: set environment variable
run: |
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
Expand All @@ -71,4 +69,4 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
#--qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake --qt-version=${{ matrix.qt-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
6 changes: 2 additions & 4 deletions .github/workflows/premake5-qt-ubuntu-gmake2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ jobs:
cache: true
cache-key-prefix: 'qt-action@v4-${{matrix.qt-version}}_ubuntu'

- name: set path
- name: set environment variable
run: |
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
Expand All @@ -71,4 +69,4 @@ jobs:
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
#--qt-root=/home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake2 --qt-version=${{ matrix.qt-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt gmake2 --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
7 changes: 2 additions & 5 deletions .github/workflows/premake5-qt-ubuntu-ninja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,10 @@ jobs:
cache: true
cache-key-prefix: 'qt-action@v4-Qt${{matrix.qt-version}}_ubuntu'

- name: set path
- name: set environment variable
run: |
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
ls $QT_ROOT_DIR/bin
# /home/runner/work/premake-sample-projects/Qt/5.15.0/gcc_64

- name: install libxkbcommon-x11-0 # display dependency
Expand All @@ -86,4 +83,4 @@ jobs:
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as Qt widget requires displays :/
# Cannot use environment variable ($QT_ROOT_DIR ) in command line, so use environment variable (QT_DIR) or its hardcoded value
xvfb-run -a python3 ./test_projects.py premake5 projects-qt ninja --qt-version=${{ matrix.qt-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt ninja --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
6 changes: 2 additions & 4 deletions .github/workflows/premake5-qt-ubuntu-qmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ jobs:
- name: test qmake
run: qmake --version

- name: set path
- name: set environment variable
run: |
echo PATH=$PATH:`pwd`
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
echo QT_DIR=$QT_ROOT_DIR
echo QT_DIR=$QT_ROOT_DIR >> $GITHUB_ENV
Expand All @@ -75,4 +73,4 @@ jobs:
- name: test projects default(gcc)
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as Qt widget requires displays :/
xvfb-run -a python3 ./test_projects.py premake5 projects-qt qmake --qt-version=${{ matrix.qt-version }}
xvfb-run -a python3 ./test_projects.py premake5 projects-qt qmake --scripts=`pwd` --qt-version=${{ matrix.qt-version }}
2 changes: 1 addition & 1 deletion .github/workflows/premake5-qt-windows-msvc-2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ jobs:

- name: test projects
run: |
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects-qt vs2019 --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-version }}
python3 ./test_projects.py premake5 projects-qt vs2019 --scripts=`pwd` --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-version }}
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/premake5-qt-windows-msvc-2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ jobs:

- name: test projects
run: |
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects-qt vs2022 --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-version }}
python3 ./test_projects.py premake5 projects-qt vs2022 --scripts=`pwd` --qt-root=$QT_ROOT_DIR --qt-version=${{ matrix.qt-version }}
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/premake5-ubuntu-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
echo "require 'submodules/premake-cmake/cmake'" >> premake-system.lua
- name: test projects
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects cmake
run: python3 ./test_projects.py premake5 projects cmake --scripts=`pwd`
10 changes: 3 additions & 7 deletions .github/workflows/premake5-ubuntu-codeblocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,17 @@ jobs:
mkdir -p ~/.config/codeblocks
cp codeblocks/default.conf ~/.config/codeblocks/
- name: Set path
run: |
echo `pwd` >> $GITHUB_PATH
- name: test projects default(gcc)
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as codeblocks requires displays :/
xvfb-run -a python3 ./test_projects.py premake5 projects codeblocks
xvfb-run -a python3 ./test_projects.py premake5 projects codeblocks --scripts=`pwd`
- name: test projects gcc
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as codeblocks requires displays :/
xvfb-run -a python3 ./test_projects.py premake5 projects codeblocks --cc=gcc
xvfb-run -a python3 ./test_projects.py premake5 projects codeblocks --scripts=`pwd` --cc=gcc
- name: test projects clang
timeout-minutes: 5 # tends to not stop properly in case of failure
run: | # fake X-server as codeblocks requires displays :/
xvfb-run -a python3 ./test_projects.py premake5 projects codeblocks --cc=clang
xvfb-run -a python3 ./test_projects.py premake5 projects codeblocks --scripts=`pwd` --cc=clang
6 changes: 3 additions & 3 deletions .github/workflows/premake5-ubuntu-codelite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
run: xvfb-run -a codelite --version || exit 0 # codelite --version returns -1

- name: test projects default(clang)
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects codelite
run: python3 ./test_projects.py premake5 projects codelite

- name: test projects gcc
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects codelite --cc=gcc
run: python3 ./test_projects.py premake5 projects codelite --cc=gcc

- name: test projects clang
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects codelite --cc=clang
run: python3 ./test_projects.py premake5 projects codelite --cc=clang
6 changes: 3 additions & 3 deletions .github/workflows/premake5-ubuntu-gmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
run: make --version

- name: test projects default(gcc)
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects gmake
run: python3 ./test_projects.py premake5 projects gmake

- name: test projects gcc
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects gmake --cc=gcc
run: python3 ./test_projects.py premake5 projects gmake --cc=gcc

- name: test projects clang
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects gmake --cc=clang
run: python3 ./test_projects.py premake5 projects gmake --cc=clang
6 changes: 3 additions & 3 deletions .github/workflows/premake5-ubuntu-gmake2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
run: make --version

- name: test projects default(gcc)
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects gmake2
run: python3 ./test_projects.py premake5 projects gmake2

- name: test projects gcc
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects gmake2 --cc=gcc
run: python3 ./test_projects.py premake5 projects gmake2 --cc=gcc

- name: test projects clang
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects gmake2 --cc=clang
run: python3 ./test_projects.py premake5 projects gmake2 --cc=clang
6 changes: 3 additions & 3 deletions .github/workflows/premake5-ubuntu-ninja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
echo "require 'submodules/premake-ninja/ninja'" >> premake-system.lua
- name: test projects default(gcc)
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects ninja
run: python3 ./test_projects.py premake5 projects ninja --scripts=`pwd`

- name: test projects gcc
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects ninja --cc=gcc
run: python3 ./test_projects.py premake5 projects ninja --scripts=`pwd` --cc=gcc

- name: test projects clang
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects ninja --cc=clang
run: python3 ./test_projects.py premake5 projects ninja --scripts=`pwd` --cc=clang
6 changes: 3 additions & 3 deletions .github/workflows/premake5-ubuntu-qmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
run: qmake --version

- name: test projects default(gcc)
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects qmake
run: python3 ./test_projects.py premake5 projects qmake --scripts=`pwd`

- name: test projects gcc
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects qmake --cc=gcc
run: python3 ./test_projects.py premake5 projects qmake --scripts=`pwd` --cc=gcc

- name: test projects clang
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects qmake --cc=clang
run: python3 ./test_projects.py premake5 projects qmake --scripts=`pwd` --cc=clang
2 changes: 1 addition & 1 deletion .github/workflows/premake5-windows-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ jobs:
echo "require 'submodules/premake-cmake/cmake'" >> premake-system.lua
- name: test projects
run: PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects cmake --shell=posix
run: python3 ./test_projects.py premake5 projects cmake --scripts=`pwd` --shell=posix
shell: bash
5 changes: 1 addition & 4 deletions .github/workflows/premake5-windows-gmake2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ jobs:

- name: test projects
run: |
echo $PATH
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects gmake2 --shell=posix
python3 ./test_projects.py premake5 projects gmake2 --shell=posix
shell: bash

# - name: test projects
# run: |
# echo %PATH%
# set PATH=%PATH%;`pwd`
# python3 ./test_projects.py premake5 projects gmake2
# shell: cmd
4 changes: 2 additions & 2 deletions .github/workflows/premake5-windows-msvc-2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
- name: test projects (default=msc)
run: |
#"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects vs2019
python3 ./test_projects.py premake5 projects vs2019
shell: bash

- name: test projects (clang)
run: |
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects vs2019 --cc=clang
python3 ./test_projects.py premake5 projects vs2019 --cc=clang
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/premake5-windows-msvc-2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
- name: test projects (default=msc)
run: |
#"C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects vs2022
python3 ./test_projects.py premake5 projects vs2022
shell: bash

- name: test projects (clang)
run: |
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects vs2022 --cc=clang
python3 ./test_projects.py premake5 projects vs2022 --cc=clang
shell: bash
Loading

0 comments on commit 2400b3e

Please sign in to comment.