Skip to content

Commit

Permalink
Add status input into windows GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Dec 1, 2023
1 parent f162608 commit 7f6ae49
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ on:
branch:
description: 'Run tests against branch'
default: 'master'
status:
description: 'Run tests against status (use `any` as wildcard)'
default: 'passed'
required: true
type: choice
options:
- passed
- any
build:
description: 'Run tests against build number'
required: false
default: 'latest'

jobs:
setup:
Expand All @@ -29,7 +41,7 @@ jobs:
working-directory: ${{ env.WORK_DIR }}
run: |
bundle install
rake get_latest_windows_tests[%BRANCH%,cardano-wallet-tests-win64]
rake get_latest_windows_tests[%BRANCH%,cardano-wallet-tests-win64 , ${{ github.event.inputs.status }} , ${{ github.event.inputs.build }}]
- name: Report version
working-directory: ${{ env.WORK_DIR }}
Expand Down
10 changes: 7 additions & 3 deletions test/e2e/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,16 @@ task :display_versions, [:bin_dir] do |_task, args|
end
end

task :get_latest_windows_tests, [:branch, :destination] do |_task, args|
branch = args[:branch] || 'master'
task :get_latest_windows_tests, [:branch, :destination, :status, :build] do |_task, args|
destination = args[:destination] || 'cardano-wallet-tests-win64'
job_key = 'build-windows-tests'
bk = Buildkite.new
last_build = bk.last_build_number(branch: branch, state: 'passed')
status = args[:status]
branch = args[:branch] || 'master'
build = args[:build] || 'latest'
options = status == 'any' ? { branch: branch } : { branch: branch, state: status }
last_build =
build == 'latest' ? bk.last_build_number(options) : build
log "Latest passing buildkite '#{bk.pipeline}' pipeline for branch '#{branch}' is #{last_build}"
jobs = bk.jobs(last_build)
mk_dir(destination)
Expand Down
1 change: 1 addition & 0 deletions test/e2e/helpers/buildkite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def get_artifact_url(build_no, job_id)
end

def get_artifacts(build_no, job_id, target_dir, target_file = 'binary-dist', unzip: true)
log "Downloading artifacts for build #{build_no} job #{job_id} to #{target_dir}"
url = get_artifact_url(build_no, job_id)
wget(url, target_file)
unzip_artifact(target_file, target_dir) if unzip
Expand Down

0 comments on commit 7f6ae49

Please sign in to comment.