From d0972015d3ad94d5862f40aef857023288bfd849 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 11 Sep 2024 13:35:51 +0300 Subject: [PATCH] test Signed-off-by: onur-ozkan --- .../actions/download-and-verify/action.yml | 32 +++++++++++++++++++ .github/workflows/test.yml | 9 ++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/actions/download-and-verify/action.yml diff --git a/.github/actions/download-and-verify/action.yml b/.github/actions/download-and-verify/action.yml new file mode 100644 index 0000000000..e787642168 --- /dev/null +++ b/.github/actions/download-and-verify/action.yml @@ -0,0 +1,32 @@ +name: "Download and verify remote files" + +runs: + using: "composite" + steps: + - name: Download + shell: bash + run: | + if [[ "$RUNNER_OS" == "Windows" ]]; then + Invoke-WebRequest -Uri ${{ inputs.url }} -OutFile ${{ inputs.output_file }} + else + curl -L -o ${{ inputs.output_file }} ${{ inputs.url }} + fi + + - name: Verify + shell: bash + run: | + if [[ "$RUNNER_OS" == "Windows" ]]; then + echo "${{ inputs.checksum }} ${{ inputs.output_file }}" | certutil -hashfile - SHA256 | findstr "${{ inputs.checksum }}" + else + echo "${{ inputs.checksum }} ${{ inputs.output_file }}" | sha256sum --check + fi +inputs: + url: + description: "URL of the remote file." + required: true + output_file: + description: "Output path." + required: true + checksum: + description: "Expected checksum of the downloaded file." + required: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02f684bfe5..1e61d7e473 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -241,12 +241,17 @@ jobs: - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Download geckodriver + uses: ./.github/actions/download-and-verify + with: + url: "https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-linux64.tar.gz" + output_file: "geckodriver-v0.32.2-linux64.tar.gz" + checksum: "1eab226bf009599f5aa1d77d9ed4c374e10a03fd848b500be1b32cefd2cbec65" + - name: Install firefox and geckodriver run: | sudo apt-get update -y sudo apt-get install -y firefox - wget https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-linux64.tar.gz - echo "1eab226bf009599f5aa1d77d9ed4c374e10a03fd848b500be1b32cefd2cbec64 geckodriver-v0.32.2-linux64.tar.gz" | sha256sum -c sudo tar -xzvf geckodriver-v0.32.2-linux64.tar.gz -C /bin sudo chmod +x /bin/geckodriver