Skip to content

Commit f3c4fd4

Browse files
committed
Test windows install
1 parent 413d337 commit f3c4fd4

4 files changed

Lines changed: 59 additions & 3 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: Configure Poetry for Windows
3+
description: GitHub Action to configure a poetry project for windows runner
4+
5+
outputs:
6+
BUILD_NUMBER:
7+
description: The build number, incremented or reused if already cached
8+
value: ${{ steps.get_build_number.outputs.BUILD_NUMBER }}
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Set build parameters
14+
shell: bash
15+
env:
16+
ARTIFACTORY_READER_ROLE: private-reader
17+
run: |
18+
echo "ARTIFACTORY_READER_ROLE=${ARTIFACTORY_READER_ROLE}" >> "$GITHUB_ENV"
19+
- uses: SonarSource/ci-github-actions/get-build-number@v1
20+
id: get_build_number
21+
- name: Cache local Poetry cache
22+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
23+
with:
24+
path: ${{ github.workspace }}/.cache/pypoetry
25+
key: poetry-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
26+
restore-keys: poetry-${{ runner.os }}-
27+
- name: Vault
28+
# yamllint disable rule:line-length
29+
id: secrets
30+
uses: SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # 3.1.0
31+
with:
32+
secrets: |
33+
development/artifactory/token/{REPO_OWNER_NAME_DASH}-${{ env.ARTIFACTORY_READER_ROLE }} access_token | ARTIFACTORY_ACCESS_TOKEN;
34+
# yamllint enable rule:line-length
35+
- name: Install JFrog
36+
id: install_jfrog
37+
shell: pwsh
38+
run: |
39+
Start-Process -Wait -Verb RunAs powershell '-NoProfile iwr https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/[RELEASE]/jfrog-cli-windows-amd64/jf.exe -OutFile $env:SYSTEMROOT\system32\jf.exe'
40+
jf intro
41+
- name: Install Poetry
42+
id: install_poetry
43+
shell: bash
44+
run: |
45+
pip install poetry==2.2.1
46+
- name: Config Poetry
47+
id: config
48+
shell: bash
49+
env:
50+
ARTIFACTORY_URL: https://repox.jfrog.io/artifactory
51+
ARTIFACTORY_PYPI_REPO: sonarsource-pypi
52+
ARTIFACTORY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
53+
run: |
54+
${GITHUB_ACTION_PATH}/../../scripts/config-poetry.sh
55+

.github/actions/config-poetry/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ runs:
4242
env:
4343
ARTIFACTORY_URL: https://repox.jfrog.io/artifactory
4444
ARTIFACTORY_PYPI_REPO: sonarsource-pypi
45-
ARTIFACTORY_ACCESS_TOKEN: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN || '' }}
45+
ARTIFACTORY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
4646
run: |
4747
mise use -g poetry@2.2.1
4848
mise use -g jfrog-cli@2.77.0
49-
${GITHUB_ACTION_PATH}/config-poetry.sh
49+
${GITHUB_ACTION_PATH}/../../scripts/config-poetry.sh
5050
File renamed without changes.

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ jobs:
126126
contents: write
127127
steps:
128128
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
129-
- uses: ./.github/actions/config-poetry
129+
- uses: ./.github/actions/config-poetry-win
130130
- run: |
131131
poetry run pytest tests/
132132
133+
133134
its:
134135
name: "Integration Tests"
135136
runs-on: github-ubuntu-latest-s

0 commit comments

Comments
 (0)