Skip to content

Commit 4f5ce07

Browse files
committed
CI: move Azure login closer to signing step in Windows workflow
Azure login tokens now appear to expire after 5 minutes. To avoid authentication issues, the login step is now performed immediately before signing the binaries. Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
1 parent 0dca906 commit 4f5ce07

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

.github/workflows/development.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,35 @@ jobs:
108108
with:
109109
fetch-depth: 0
110110

111-
- name: Azure login
112-
if: ${{ github.event_name != 'pull_request' }}
113-
uses: azure/login@v2
114-
with:
115-
client-id: ${{ secrets.AZURE_CLIENT_ID }}
116-
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
117-
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
118-
119111
- name: Set up Go
120112
uses: actions/setup-go@v6
121113
with:
122114
go-version: '1.24'
123115

116+
- name: Run test cases using SQLite provider
117+
run: go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 15m ./... -coverprofile=coverage.txt -covermode=atomic
118+
119+
- name: Run test cases using bolt provider
120+
run: |
121+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/config -covermode=atomic
122+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/common -covermode=atomic
123+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/httpd -covermode=atomic
124+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 8m ./internal/sftpd -covermode=atomic
125+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/ftpd -covermode=atomic
126+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/webdavd -covermode=atomic
127+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/telemetry -covermode=atomic
128+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/mfa -covermode=atomic
129+
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/command -covermode=atomic
130+
env:
131+
SFTPGO_DATA_PROVIDER__DRIVER: bolt
132+
SFTPGO_DATA_PROVIDER__NAME: 'sftpgo_bolt.db'
133+
134+
- name: Run test cases using memory provider
135+
run: go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 15m ./... -covermode=atomic
136+
env:
137+
SFTPGO_DATA_PROVIDER__DRIVER: memory
138+
SFTPGO_DATA_PROVIDER__NAME: ''
139+
124140
- name: Build
125141
run: |
126142
$GIT_COMMIT = (git describe --always --abbrev=8 --dirty) | Out-String
@@ -152,6 +168,14 @@ jobs:
152168
Remove-Item Env:\GOOS
153169
Remove-Item Env:\GOARCH
154170
171+
- name: Azure login
172+
if: ${{ github.event_name != 'pull_request' }}
173+
uses: azure/login@v2
174+
with:
175+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
176+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
177+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
178+
155179
- name: Sign binaries
156180
if: ${{ github.event_name != 'pull_request' }}
157181
uses: azure/trusted-signing-action@v0.5.9
@@ -177,30 +201,6 @@ jobs:
177201
exclude-azure-developer-cli-credential: true
178202
exclude-interactive-browser-credential: true
179203

180-
- name: Run test cases using SQLite provider
181-
run: go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 15m ./... -coverprofile=coverage.txt -covermode=atomic
182-
183-
- name: Run test cases using bolt provider
184-
run: |
185-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/config -covermode=atomic
186-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/common -covermode=atomic
187-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/httpd -covermode=atomic
188-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 8m ./internal/sftpd -covermode=atomic
189-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/ftpd -covermode=atomic
190-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 5m ./internal/webdavd -covermode=atomic
191-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/telemetry -covermode=atomic
192-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/mfa -covermode=atomic
193-
go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 2m ./internal/command -covermode=atomic
194-
env:
195-
SFTPGO_DATA_PROVIDER__DRIVER: bolt
196-
SFTPGO_DATA_PROVIDER__NAME: 'sftpgo_bolt.db'
197-
198-
- name: Run test cases using memory provider
199-
run: go test -v -tags nopgxregisterdefaulttypes,disable_grpc_modules -p 1 -timeout 15m ./... -covermode=atomic
200-
env:
201-
SFTPGO_DATA_PROVIDER__DRIVER: memory
202-
SFTPGO_DATA_PROVIDER__NAME: ''
203-
204204
- name: Initialize data provider
205205
run: |
206206
rm sftpgo.db

0 commit comments

Comments
 (0)