diff --git a/.github/wip_integration_tests.yml b/.github/wip_integration_tests.yml deleted file mode 100644 index 36312e3442..0000000000 --- a/.github/wip_integration_tests.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -name: CI - -on: - push: - pull_request: - types: [opened] - -env: - toolchain: nightly-2022-05-01 - -jobs: - integration: - name: integration - runs-on: ubuntu-20.04 - steps: - - name: checkout - uses: actions/checkout@v2 - - name: cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-build-release-${{ hashFiles('**/Cargo.lock') }} - - name: toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.toolchain }} - components: clippy, rustfmt - override: true - - name: dependencies - run: | - sudo apt-get update && \ - sudo apt-get -y install \ - libssl-dev \ - clang-10 \ - pkg-config \ - git \ - cmake \ - zip \ - libc++-dev \ - libc++abi-dev \ - libprotobuf-dev \ - protobuf-compiler - - name: npm ci and lint - run: | - node -v - cd integration_tests - npm ci - npm run check-fmt - npm run lint - - name: build - run: | - cargo build --release --bin tari_base_node - cargo build --release --bin tari_console_wallet - cargo build --release --bin tari_merge_mining_proxy - cargo build --release --bin tari_miner - cargo build --release --package tari_wallet_ffi - - name: run cucumber scenarios - run: | - cd integration_tests - mkdir -p cucumber_output - node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit --retry 2 --retryTagFilter "@flaky and not @broken" - - name: generate report - run: | - cd integration_tests - node ./generate_report.js - - name: run ffi wallet cucumber scenarios - run: | - cd integration_tests - mkdir -p cucumber_output - node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @flaky and @wallet-ffi" --format json:cucumber_output/tests_ffi.cucumber --exit - - name: generate ffi report - run: | - cd integration_tests - node ./generate_report.js "cucumber_output/tests_ffi.cucumber" "temp/reports/cucumber_ffi_report.html" diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index cf7ef0d5bf..c6b88e47eb 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -5,12 +5,23 @@ name: Integration tests push: paths-ignore: - '**/*.md' - branches: - - 'ci-*' schedule: - - cron: '0 2 * * *' # daily @ 02h00 - - cron: '0 12 * * 6' # weekly - Saturday @ noon + - cron: '0 2 * * *' # daily @ 02h00 (non-critical) + - cron: '0 12 * * 6' # weekly - Saturday @ noon (long-running) workflow_dispatch: + inputs: + ci_bins: + type: boolean + default: true + description: 'run ci on binaries' + ci_ffi: + type: boolean + default: true + description: 'run ci on ffi' + ci_profile: + default: ci + description: 'ci profile to run' + type: string env: toolchain: nightly-2022-05-01 @@ -18,14 +29,14 @@ env: build_binaries: "tari_base_node tari_console_wallet tari_merge_mining_proxy tari_miner" jobs: - long-running: + cucumber_tests: name: Cucumber tests runs-on: ubuntu-latest steps: - name: Checkout source code uses: actions/checkout@v3 - - name: Envs setup for ${{ env.CI_RUN }} + - name: Envs setup id: envs_setup shell: bash run: | @@ -38,13 +49,21 @@ jobs: done echo "TARGET_BINS=${VAPPS_TARGET_BINS}" >> $GITHUB_ENV if [ "${{ github.event_name }}" == "schedule" ] ; then + echo "CI_FFI=false" >> $GITHUB_ENV if [ "${{ github.event.schedule }}" == "0 2 * * *" ] ; then - echo "CI_RUN=non-critical" >> $GITHUB_ENV + echo "CI_PROFILE=non-critical" >> $GITHUB_ENV elif [ "${{ github.event.schedule }}" == "0 12 * * 6" ] ; then - echo "CI_RUN=long-running" >> $GITHUB_ENV + echo "CI_PROFILE=long-running" >> $GITHUB_ENV fi else - echo "CI_RUN=non-critical" >> $GITHUB_ENV + echo "CI ..." + echo "CI_PROFILE=ci" >> $GITHUB_ENV + CI_BINS=${{ inputs.ci_bins }} + echo "Run binary - ${CI_BINS}" + echo "CI_BINS=${CI_BINS:-true}" >> $GITHUB_ENV + CI_FFI=${{ inputs.ci_ffi }} + echo "Run FFI - ${CI_FFI}" + echo "CI_FFI=${CI_FFI:-true}" >> $GITHUB_ENV fi - name: Install ubuntu dependencies @@ -120,27 +139,47 @@ jobs: npm install npm ci - - name: Run ${{ env.CI_RUN }} integration tests + - name: Run ${{ env.CI_PROFILE }} integration tests for binaries + if: ${{ env.CI_BINS == 'true' }} continue-on-error: true + timeout-minutes: 90 shell: bash working-directory: integration_tests run: | - node_modules/.bin/cucumber-js --profile "${{ env.CI_RUN }}" \ + node_modules/.bin/cucumber-js --publish-quiet \ + --profile "${{ env.CI_PROFILE }}" \ --tags "not @wallet-ffi" --format json:cucumber_output/tests.cucumber \ --exit --retry 2 --retry-tag-filter "@flaky and not @broken" + - name: Run ${{ env.CI_PROFILE }} integration tests for ffi + if: ${{ env.CI_FFI == 'true' }} + continue-on-error: true + timeout-minutes: 90 + shell: bash + working-directory: integration_tests + run: | + node_modules/.bin/cucumber-js --publish-quiet \ + --profile "${{ env.CI_PROFILE }}" \ + --tags "@wallet-ffi" --format json:cucumber_output/tests_ffi.cucumber \ + --exit --retry 2 --retry-tag-filter "@flaky and not @broken" + - name: Generate report continue-on-error: true if: always() shell: bash working-directory: integration_tests - run: node ./generate_report.js + run: | + node ./generate_report.js + # Empty file check + if [ -s cucumber_output/tests_ffi.cucumber ] ; then + node ./generate_report.js "cucumber_output/tests_ffi.cucumber" "temp/reports/cucumber_ffi_report.html" + fi - - name: Store ${{ env.CI_RUN }} test results + - name: Store ${{ env.CI_PROFILE }} test results uses: actions/upload-artifact@v3 if: always() with: - name: ${{ env.CI_RUN }} test results + name: ${{ env.CI_PROFILE }} test results path: | integration_tests/cucumber_output integration_tests/temp/reports