From f96f0582aba410a9f1008f1f9105cd0ea876c49f Mon Sep 17 00:00:00 2001 From: Shahzad Lone Date: Tue, 17 Sep 2024 18:23:27 -0400 Subject: [PATCH] Intro sourcehub install --- .../composites/install-sourcehub/action.yml | 36 ++++++++++++++ .../workflows/test-and-upload-coverage.yml | 47 +++++++++---------- 2 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 .github/composites/install-sourcehub/action.yml diff --git a/.github/composites/install-sourcehub/action.yml b/.github/composites/install-sourcehub/action.yml new file mode 100644 index 0000000000..d0800faed1 --- /dev/null +++ b/.github/composites/install-sourcehub/action.yml @@ -0,0 +1,36 @@ +# Copyright 2024 Democratized Data Foundation +# +# Use of this software is governed by the Business Source License +# included in the file licenses/BSL.txt. +# +# As of the Change Date specified in that file, in accordance with +# the Business Source License, use of this software will be governed +# by the Apache License, Version 2.0, included in the file +# licenses/APL.txt. + +name: 'Install SourceHub' + +description: 'Composite action to install sourcehub' + +inputs: + ref: + description: 'The branch, tag or SHA to install' + required: true + default: 'coverage_default' + +runs: + # This is a composite action, setting this is required. + using: "composite" + + steps: + - name: Checkout sourcehub code into the directory + uses: actions/checkout@v4 + with: + repository: sourcenetwork/sourcehub + path: _sourceHub + ref: ${{ inputs.ref }} + + - name: Install SourceHub CLI + working-directory: _sourceHub + run: make install + diff --git a/.github/workflows/test-and-upload-coverage.yml b/.github/workflows/test-and-upload-coverage.yml index 0dd233b5d2..4f959a4a52 100644 --- a/.github/workflows/test-and-upload-coverage.yml +++ b/.github/workflows/test-and-upload-coverage.yml @@ -74,7 +74,6 @@ jobs: DEFRA_BADGER_FILE: ${{ matrix.database-type == 'file' }} DEFRA_MUTATION_TYPE: ${{ matrix.mutation-type }} - steps: - name: Checkout code into the directory uses: actions/checkout@v4 @@ -92,6 +91,7 @@ jobs: " coverage-path: coverage.txt + # This job runs the tests on other operating systems using default configurations. test-os: name: Test os job @@ -146,20 +146,12 @@ jobs: - name: Setup defradb uses: ./.github/composites/setup-defradb - # We have to checkout the source-hub repo and install it ourselves because it - # contains replace commands in its go.mod file. - - name: Checkout sourcehub code into the directory - uses: actions/checkout@v4 - with: - repository: sourcenetwork/sourcehub - path: _sourceHub - # Lock the sourcehub version until the dev branch is stable - # remove this when closed https://github.com/sourcenetwork/defradb/issues/2865 - ref: c232133c35c96924509a4d955a7b450eb3624a15 - - - name: Install SourceHub CLI - working-directory: _sourceHub - run: make install + # We have to install it ourselves because it contains replace commands in its go.mod file. + - name: Install sourcehub + uses: ./.github/composites/install-sourcehub + # Lock the sourcehub version until the dev branch is stable + # remove this when closed https://github.com/sourcenetwork/defradb/issues/2865 + ref: c232133c35c96924509a4d955a7b450eb3624a15 - name: Test coverage & save coverage report in an artifact uses: ./.github/composites/test-coverage-with-artifact @@ -170,6 +162,7 @@ jobs: " coverage-path: coverage.txt + # The lens matrix job tests the wazero and wasmer lens on linux. test-lens: name: Test lens job @@ -197,14 +190,15 @@ jobs: coverage-artifact-name: "coverage_lens_${{ matrix.lens-type }}" coverage-path: coverage.txt - # This job runs the database with encryption tests using default configuration, on linux. - test-encryption: - name: Test encryption job + + # This job runs the materialized view tests using default configuration, on linux. + test-view: + name: Test view job runs-on: ubuntu-latest env: - DEFRA_BADGER_ENCRYPTION: true + DEFRA_VIEW_TYPE: materialized steps: - name: Checkout code into the directory @@ -216,17 +210,18 @@ jobs: - name: Test coverage & save coverage report in an artifact uses: ./.github/composites/test-coverage-with-artifact with: - coverage-artifact-name: "coverage_encryption" + coverage-artifact-name: "coverage_view_materialized" coverage-path: coverage.txt - # This job runs the materialized view tests using default configuration, on linux. - test-view: - name: Test view job + + # This job runs the database with encryption tests using default configuration, on linux. + test-encryption: + name: Test encryption job runs-on: ubuntu-latest env: - DEFRA_VIEW_TYPE: materialized + DEFRA_BADGER_ENCRYPTION: true steps: - name: Checkout code into the directory @@ -238,7 +233,7 @@ jobs: - name: Test coverage & save coverage report in an artifact uses: ./.github/composites/test-coverage-with-artifact with: - coverage-artifact-name: "coverage_view_materialized" + coverage-artifact-name: "coverage_encryption" coverage-path: coverage.txt @@ -251,8 +246,8 @@ jobs: - test-os # 1 test(s) [excluding windows] - test-acp # 3 test(s) - test-lens # 2 test(s) - - test-encryption # 1 test(s) - test-view # 1 test(s) + - test-encryption # 1 test(s) # Important to know: # - We didn't use `if: always()` here, so this job doesn't run if we manually canceled.