Skip to content

Commit e570619

Browse files
authored
Fixes for Zizmor security alerts (#575)
* Make tag pins more specific * Use Powershell rather than CMD
1 parent cad4c0e commit e570619

File tree

7 files changed

+66
-63
lines changed

7 files changed

+66
-63
lines changed

.github/workflows/build_docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5454

5555
- name: Setup Python
56-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
56+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5757
with:
5858
python-version: '3.13' # Use 3.13 as no PyTorch wheels for 3.14 yet.
5959

@@ -66,7 +66,7 @@ jobs:
6666
run: ford FTorch.md
6767

6868
- name: Test docs build
69-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4
69+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
7070
with:
7171
branch: docs-test # The branch the action should deploy to.
7272
folder: doc # The folder the action should deploy.
@@ -102,7 +102,7 @@ jobs:
102102
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
103103

104104
- name: Setup Python
105-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
105+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
106106
with:
107107
python-version: '3.13' # Use 3.13 as no PyTorch wheels for 3.14 yet.
108108

@@ -115,7 +115,7 @@ jobs:
115115
run: ford FTorch.md
116116

117117
- name: Deploy Documentation for main
118-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4
118+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
119119
with:
120120
branch: gh-pages # The branch the action should deploy to.
121121
folder: doc # The folder the action should deploy.

.github/workflows/preprocessing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4141

4242
- name: Setup Python
43-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
43+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4444
with:
4545
python-version: '3.13' # Use 3.13 as no PyTorch wheels for 3.14 yet.
4646

.github/workflows/static_analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
# Configurable using the .clang-format and .clang-tidy config files if present
117117
- name: clang source
118118
if: always()
119-
uses: cpp-linter/cpp-linter-action@b7fbdde0f6776f478f4d8867c2b746077fa7ea89 # v2
119+
uses: cpp-linter/cpp-linter-action@77c390c5ba9c947ebc185a3e49cc754f1558abb5 # v2.18.0
120120
id: linter
121121
env:
122122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test_suite_ubuntu_cpu_gnu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ jobs:
107107
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
108108

109109
- name: Setup Fortran
110-
uses: fortran-lang/setup-fortran@d2ba6ea44297a24407def2f6e117954d844a5368 # v1
110+
uses: fortran-lang/setup-fortran@2a1b9c55897d827a9dfeb114408f3615e53b2b72 # v1.9.0
111111
with:
112112
compiler: ${{ matrix.toolchain.compiler }}
113113
version: ${{ matrix.toolchain.version }}
114114

115115
- name: Setup Python
116-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
116+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
117117
with:
118118
python-version: '3.13'
119119

.github/workflows/test_suite_ubuntu_cpu_intel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5858

5959
- name: Setup Python
60-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
60+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
6161
with:
6262
python-version: '3.13' # Use 3.13 as no PyTorch wheels for 3.14 yet.
6363

.github/workflows/test_suite_ubuntu_cuda_gnu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6464

6565
- name: Setup Python
66-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
66+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
6767
with:
6868
python-version: '3.13' # Use 3.13 as no PyTorch wheels for 3.14 yet.
6969

.github/workflows/test_suite_windows_cpu_intel.yml

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242

4343
steps:
4444
# configure windows VM with intel compilers
45-
- uses: fortran-lang/setup-fortran@d2ba6ea44297a24407def2f6e117954d844a5368 # v1
45+
- name: Setup Fortran
46+
uses: fortran-lang/setup-fortran@2a1b9c55897d827a9dfeb114408f3615e53b2b72 # v1.9.0
4647
id: setup-fortran
4748
with:
4849
compiler: ${{ matrix.toolchain.compiler }}
@@ -55,60 +56,60 @@ jobs:
5556
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5657

5758
- name: Setup Python
58-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
59+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5960
with:
6061
python-version: '3.13' # Use 3.13 as no PyTorch wheels for 3.14 yet.
6162

6263
- name: Install ftorch_utils
63-
shell: cmd
64+
shell: pwsh
6465
run: |
6566
pip install --upgrade pip
6667
python -m venv ftorch
67-
call ftorch\Scripts\activate
68+
.\ftorch\Scripts\Activate.ps1
6869
pip install . --group test
6970
7071
- name: Build FTorch
71-
shell: cmd
72+
shell: pwsh
7273
run: |
73-
call ftorch\Scripts\activate
74-
rem Find Python executable in venv
75-
for /f %%i in ('python -c "import sys; print(sys.executable)"') do set PYTHON_EXECUTABLE=%%i
76-
rem Find torch location
77-
set TORCH_PATH=
78-
for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set TORCH_PATH=%%i
79-
rem Set install location
80-
set FTORCH_INSTALL_DIR=%TEMP%\ftorch-install
81-
cmake ^
82-
-Bbuild ^
83-
-G "NMake Makefiles" ^
84-
-DPython_EXECUTABLE=%PYTHON_EXECUTABLE% ^
85-
-DCMAKE_Fortran_FLAGS="/fpscomp:logicals" ^
86-
-DCMAKE_CXX_FLAGS="/D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ^
87-
-DCMAKE_PREFIX_PATH=%TORCH_PATH% ^
88-
-DCMAKE_BUILD_TYPE=Release ^
89-
-DCMAKE_Fortran_COMPILER=ifx ^
90-
-DCMAKE_C_COMPILER=icx ^
91-
-DCMAKE_CXX_COMPILER=icx ^
92-
-DCMAKE_BUILD_TESTS=TRUE ^
93-
-DCMAKE_INSTALL_PREFIX=%FTORCH_INSTALL_DIR%
74+
.\ftorch\Scripts\Activate.ps1
75+
# Find Python executable in venv
76+
$PYTHON_EXECUTABLE = python -c "import sys; print(sys.executable)"
77+
# Find torch location
78+
$Torch_DIR = (pip show torch | Select-String -Pattern "^Location" | ForEach-Object { $_.Line -replace "^Location:\s*", "" })
79+
# Set install location
80+
$FTORCH_INSTALL_DIR = "$env:TEMP\ftorch-install"
81+
cmake `
82+
-Bbuild `
83+
-G "NMake Makefiles" `
84+
-DPython_EXECUTABLE="$PYTHON_EXECUTABLE" `
85+
-DCMAKE_Fortran_FLAGS="/fpscomp:logicals" `
86+
-DCMAKE_CXX_FLAGS="/D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" `
87+
-DCMAKE_PREFIX_PATH="$Torch_DIR\torch" `
88+
-DCMAKE_BUILD_TYPE=Release `
89+
-DCMAKE_Fortran_COMPILER=ifx `
90+
-DCMAKE_C_COMPILER=icx `
91+
-DCMAKE_CXX_COMPILER=icx `
92+
-DCMAKE_BUILD_TESTS=TRUE `
93+
-DCMAKE_INSTALL_PREFIX="$FTORCH_INSTALL_DIR"
9494
cmake --build build
9595
cmake --install build
9696
9797
- name: Run Python unit tests
98-
shell: cmd
98+
shell: pwsh
9999
run: |
100-
call ftorch\Scripts\activate
100+
.\ftorch\Scripts\Activate.ps1
101101
pytest --verbose test/ftorch_utils
102102
103103
- name: Integration tests
104-
shell: cmd
104+
shell: pwsh
105105
run: |
106-
call ftorch\Scripts\activate
107-
set TORCH_PATH=
108-
for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set TORCH_PATH=%%i
109-
set FTORCH_INSTALL_DIR=%TEMP%\ftorch-install
110-
set PATH=%FTORCH_INSTALL_DIR%\bin;%PATH%
111-
set PATH=%TORCH_PATH%\torch\lib;%PATH%
106+
.\ftorch\Scripts\Activate.ps1
107+
# Find Python executable in venv
108+
$Torch_DIR = (pip show torch | Select-String -Pattern "^Location" | ForEach-Object { $_.Line -replace "^Location:\s*", "" })
109+
# Set install location
110+
$FTORCH_INSTALL_DIR = "$env:TEMP\ftorch-install"
111+
# Add FTorch and PyTorch to the path for the test executables
112+
$env:PATH = "$FTORCH_INSTALL_DIR\bin;$Torch_DIR\torch\lib;$env:PATH"
112113
cd build
113114
ctest --verbose --tests-regex example_tensor
114115
ctest --verbose --tests-regex example_simplenet
@@ -117,25 +118,27 @@ jobs:
117118
ctest --verbose --tests-regex example_autograd
118119
119120
- name: Standalone SimpleNet example
120-
shell: cmd
121+
shell: pwsh
121122
run: |
122-
call ftorch\Scripts\activate
123-
for /f %%i in ('python -c "import sys; print(sys.executable)"') do set PYTHON_EXECUTABLE=%%i
124-
set TORCH_PATH=
125-
for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set TORCH_PATH=%%i
126-
set FTORCH_INSTALL_DIR=%TEMP%\ftorch-install
127-
set PATH=%FTORCH_INSTALL_DIR%\bin;%PATH%
128-
set PATH=%TORCH_PATH%\torch\lib;%PATH%
129-
set EXAMPLE_BUILD_DIR=examples\02_SimpleNet\build
130-
if not exist %EXAMPLE_BUILD_DIR% mkdir %EXAMPLE_BUILD_DIR%
131-
cd %EXAMPLE_BUILD_DIR%
132-
cmake .. ^
133-
-G "NMake Makefiles" ^
134-
-DCMAKE_Fortran_COMPILER=ifx ^
135-
-DCMAKE_Fortran_FLAGS="/fpscomp:logicals" ^
136-
-DPython_EXECUTABLE=%PYTHON_EXECUTABLE% ^
137-
-DCMAKE_BUILD_TYPE=Release ^
138-
-DCMAKE_PREFIX_PATH=%FTORCH_INSTALL_DIR%;%TORCH_PATH% ^
123+
.\ftorch\Scripts\Activate.ps1
124+
# Find Python executable in venv
125+
$PYTHON_EXECUTABLE = python -c "import sys; print(sys.executable)"
126+
# Find torch location
127+
$Torch_DIR = (pip show torch | Select-String -Pattern "^Location" | ForEach-Object { $_.Line -replace "^Location:\s*", "" })
128+
# Set install location
129+
$FTORCH_INSTALL_DIR = "$env:TEMP\ftorch-install"
130+
# Add FTorch and PyTorch to the path for the test executables
131+
$env:PATH = "$FTORCH_INSTALL_DIR\bin;$Torch_DIR\torch\lib;$env:PATH"
132+
$EXAMPLE_BUILD_DIR = "examples\02_SimpleNet\build"
133+
if (-not (Test-Path $EXAMPLE_BUILD_DIR)) { New-Item -ItemType Directory -Path $EXAMPLE_BUILD_DIR | Out-Null }
134+
cd $EXAMPLE_BUILD_DIR
135+
cmake .. `
136+
-G "NMake Makefiles" `
137+
-DCMAKE_Fortran_COMPILER=ifx `
138+
-DCMAKE_Fortran_FLAGS="/fpscomp:logicals" `
139+
-DPython_EXECUTABLE="$PYTHON_EXECUTABLE" `
140+
-DCMAKE_BUILD_TYPE=Release `
141+
-DCMAKE_PREFIX_PATH="$FTORCH_INSTALL_DIR;$Torch_DIR\torch" `
139142
-DCMAKE_BUILD_TESTS=TRUE
140143
cmake --build .
141144
ctest -V

0 commit comments

Comments
 (0)