Skip to content

Commit 6fcad27

Browse files
Set default workflow permissions
1 parent d02f447 commit 6fcad27

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.github/workflows/build-with-clang.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches: [master]
66

7+
permissions: read-all
8+
79
jobs:
810
build-with-clang:
911
name: Build project with IntelLLVM clang compiler

.github/workflows/conda-package.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ name: Conda package
22

33
on: push
44

5+
permissions: read-all
6+
57
env:
68
PACKAGE_NAME: mkl_random
79
MODULE_NAME: mkl_random
10+
TEST_ENV_NAME: test_mkl_random
811
VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
912
VER_SCRIPT2: "d = j['mkl_random'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
1013

@@ -129,7 +132,7 @@ jobs:
129132
. $CONDA/etc/profile.d/conda.sh
130133
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
131134
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
132-
conda create -n test_mkl_random $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
135+
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
133136
cat lockfile
134137
- name: Set pkgs_dirs
135138
run: |
@@ -151,14 +154,14 @@ jobs:
151154
. $CONDA/etc/profile.d/conda.sh
152155
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
153156
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
154-
conda create -n test_mkl_random $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
157+
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
155158
# Test installed packages
156159
conda list
157160
- name: Run tests
158161
run: |
159162
. $CONDA/etc/profile.d/conda.sh
160-
conda activate test_mkl_random
161-
pytest -vv --pyargs mkl_random
163+
conda activate ${{ env.TEST_ENV_NAME }}
164+
pytest -vv --pyargs ${{ env.MODULE_NAME }}
162165
163166
test_windows:
164167
needs: build_windows
@@ -202,7 +205,7 @@ jobs:
202205
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
203206
SET PACKAGE_VERSION=%%F
204207
)
205-
conda create -n test_mkl_random ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
208+
conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
206209
more lockfile
207210
- name: Cache conda packages
208211
uses: actions/cache@v4
@@ -224,10 +227,10 @@ jobs:
224227
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
225228
SET PACKAGE_VERSION=%%F
226229
)
227-
conda create -n test_mkl_random ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
230+
conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
228231
# Test installed packages
229232
conda list
230233
- name: Run tests
231234
run: |
232-
conda activate -n test_mkl_random
235+
conda activate -n ${{ env.TEST_ENV_NAME }}
233236
pytest -v --pyargs ${{ env.MODULE_NAME }}

0 commit comments

Comments
 (0)