Skip to content

Commit

Permalink
CI: Add remaining unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasser Isa authored and str4d committed Mar 5, 2024
1 parent 2b1e669 commit 08f115d
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/gcs-download-cloud-storage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ inputs:
destination:
description: 'The directory into which the files will be downloaded'
required: true
remove-first-if-exists:
description: 'Deletes the given path first (if it exists) before downloading files'

runs:
using: 'composite'
Expand Down Expand Up @@ -37,6 +39,11 @@ runs:
gs://gh-zcash/${{ inputs.path-prefix }}/${{ inputs.source }}
$RUNNER_TEMP/gcs-download
- name: Remove the specified path if it exists
if: inputs.remove-first-if-exists != ''
shell: bash
run: rm -rf ${{ inputs.remove-first-if-exists }}

- name: Ensure the target directory exists
shell: bash
run: mkdir -p ${{ inputs.destination }}
Expand Down
146 changes: 146 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,30 @@ jobs:
path: ${{ format('./src/zcash-gtest{0}', matrix.file_ext) }}
destination: gh-zcash/${{ github.run_id }}/${{ matrix.name }}/src

- name: Upload src/test/buildenv.py
uses: google-github-actions/upload-cloud-storage@v2
with:
path: ./src/test/buildenv.py
destination: gh-zcash/${{ github.run_id }}/${{ matrix.name }}/src/test

- name: Upload src/secp256k1
uses: google-github-actions/upload-cloud-storage@v2
with:
path: ./src/secp256k1
destination: gh-zcash/${{ github.run_id }}/${{ matrix.name }}/src

- name: Upload src/univalue
uses: google-github-actions/upload-cloud-storage@v2
with:
path: ./src/univalue
destination: gh-zcash/${{ github.run_id }}/${{ matrix.name }}/src

- name: Upload depends/${{ matrix.host }}/native/bin
uses: google-github-actions/upload-cloud-storage@v2
with:
path: ./depends/${{ matrix.host }}/native/bin
destination: gh-zcash/${{ github.run_id }}/${{ matrix.name }}/depends/${{ matrix.host }}/native

- name: Upload depends/${{ matrix.host }}/lib
uses: google-github-actions/upload-cloud-storage@v2
with:
Expand Down Expand Up @@ -379,6 +403,128 @@ jobs:
- name: Run Rust tests
run: cargo test

# Not designed for Windows
test-secp256k1:
name: secp256k1 tier ${{ matrix.tier }} platform ${{ matrix.platform }}
needs: [setup, build]
runs-on: ${{ matrix.test_os }}
continue-on-error: ${{ matrix.tier != 1 }}
strategy:
matrix:
include: ${{ fromJson(needs.setup.outputs.unix_test_matrix) }}
steps:
- uses: actions/checkout@v4

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Download native/bin artifact
uses: ./.github/actions/gcs-download-cloud-storage
with:
path-prefix: ${{ github.run_id }}/${{ matrix.name }}
source: depends/${{ matrix.host }}/native/bin
destination: ./depends/${{ matrix.host }}/native/

- name: Download src/secp256k1 artifact
uses: ./.github/actions/gcs-download-cloud-storage
with:
path-prefix: ${{ github.run_id }}/${{ matrix.name }}
source: src/secp256k1
destination: ./src/
remove-first-if-exists: ./src/secp256k1

- name: Run secp256k1 test
shell: bash
run: python3 ./qa/zcash/full_test_suite.py secp256k1
env:
HOST: ${{ matrix.host }}

# Not designed for Windows
test-univalue:
name: univalue tier ${{ matrix.tier }} platform ${{ matrix.platform }}
needs: [setup, build]
runs-on: ${{ matrix.test_os }}
continue-on-error: ${{ matrix.tier != 1 }}
strategy:
matrix:
include: ${{ fromJson(needs.setup.outputs.unix_test_matrix) }}
steps:
- uses: actions/checkout@v4

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Download native/bin artifact
uses: ./.github/actions/gcs-download-cloud-storage
with:
path-prefix: ${{ github.run_id }}/${{ matrix.name }}
source: depends/${{ matrix.host }}/native/bin
destination: ./depends/${{ matrix.host }}/native/

- name: Download src/univalue artifact
uses: ./.github/actions/gcs-download-cloud-storage
with:
path-prefix: ${{ github.run_id }}/${{ matrix.name }}
source: src/univalue
destination: ./src/
remove-first-if-exists: ./src/univalue

- name: Make artifact executable
if: runner.os != 'Windows'
run: chmod +x ./src/univalue/build-aux/install-sh

- name: Run univalue test
shell: bash
run: python3 ./qa/zcash/full_test_suite.py univalue
env:
HOST: ${{ matrix.host }}

# Not designed for Windows
test-util:
name: util-test tier ${{ matrix.tier }} platform ${{ matrix.platform }}
needs: [setup, build]
runs-on: ${{ matrix.test_os }}
continue-on-error: ${{ matrix.tier != 1 }}
strategy:
matrix:
include: ${{ fromJson(needs.setup.outputs.unix_test_matrix) }}

steps:
- uses: actions/checkout@v4

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Download zcash-tx artifact
uses: ./.github/actions/gcs-download-cloud-storage
with:
path-prefix: ${{ github.run_id }}/${{ matrix.name }}
source: ${{ format('src/zcash-tx{0}', matrix.file_ext) }}
destination: ./src/

- name: Download src/test/buildenv.py artifact
uses: ./.github/actions/gcs-download-cloud-storage
with:
path-prefix: ${{ github.run_id }}/${{ matrix.name }}
source: src/test/buildenv.py
destination: ./src/test/

- name: Make artifact executable
if: runner.os != 'Windows'
run: chmod +x ${{ format('./src/zcash-tx{0}', matrix.file_ext) }}

- name: Run util-test test
shell: bash
run: python3 ./qa/zcash/full_test_suite.py util-test
env:
HOST: ${{ matrix.host }}

no-dot-so:
name: not-dot-so tier ${{ matrix.tier }} platform ${{ matrix.platform }}
needs: [setup, build]
Expand Down

0 comments on commit 08f115d

Please sign in to comment.