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 5aff0ac
Show file tree
Hide file tree
Showing 23 changed files with 56 additions and 80 deletions.
11 changes: 8 additions & 3 deletions .github/actions/install-premake5/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
run: |
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
shell: bash
Expand All @@ -40,14 +40,19 @@ runs:
run: |
cd premake-build
make -f Bootstrap.mak osx CONFIG=release
cp bin/release/premake5 ../
cp bin/release/premake5 /Applications/
cd ..
rm -Rf premake-build
ls -la /Applications/
echo PATH:$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
10 changes: 4 additions & 6 deletions .github/workflows/premake5-qt-mac-xcode4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ 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*"
Expand All @@ -67,14 +65,14 @@ jobs:
- 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
9 changes: 3 additions & 6 deletions .github/workflows/premake5-windows-ninja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,16 @@ jobs:
# - name: test projects default(msc-v142) # Visual Studio 2019 (version mismatch is not that important, only cl.exe is called)
# run: |
# #"C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
# echo $PATH
# PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects ninja--shell=posix
# python3 ./test_projects.py premake5 projects ninja --scripts=`pwd` --shell=posix
# shell: bash

- name: test projects msc-v143 # Visual Studio 2022
run: |
#"C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
echo $PATH
PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects ninja --cc=msc-v143 --shell=posix
python3 ./test_projects.py premake5 projects ninja --scripts=`pwd` --cc=msc-v143 --shell=posix
shell: bash

# - name: test projects gcc
# run: |
# echo $PATH
# PATH=$PATH:`pwd` python3 ./test_projects.py premake5 projects ninja --cc=gcc --shell=posix
# python3 ./test_projects.py premake5 projects ninja --scripts=`pwd` --cc=gcc --shell=posix
# shell: bash

0 comments on commit 5aff0ac

Please sign in to comment.