From 8fc817798af1e68f1301f84ded480a0260d2774f Mon Sep 17 00:00:00 2001 From: paolino Date: Fri, 1 Dec 2023 16:25:41 +0000 Subject: [PATCH] Add status input into windows GH workflow --- .github/workflows/windows.yml | 16 +++++++++++++++- test/e2e/Rakefile | 10 +++++++--- test/e2e/helpers/buildkite.rb | 1 + 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a2ad042795b..f28704dc861 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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: @@ -29,7 +41,9 @@ jobs: working-directory: ${{ env.WORK_DIR }} run: | bundle install - rake get_latest_windows_tests[%BRANCH%,cardano-wallet-tests-win64] + echo "STATUS = ${{ github.event.inputs.status }}" + echo "BUILD = ${{ github.event.inputs.build }}" + 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 }} diff --git a/test/e2e/Rakefile b/test/e2e/Rakefile index 6424ea7db64..61ad3159051 100644 --- a/test/e2e/Rakefile +++ b/test/e2e/Rakefile @@ -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) diff --git a/test/e2e/helpers/buildkite.rb b/test/e2e/helpers/buildkite.rb index 72bbee5d062..a231744daab 100644 --- a/test/e2e/helpers/buildkite.rb +++ b/test/e2e/helpers/buildkite.rb @@ -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