Skip to content

Commit

Permalink
ci: run epoch tests on core changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Long committed Sep 16, 2024
1 parent 13996ab commit df93e46
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 3 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/intigration-test-long-running.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Intigration Testing Datil Long Running
on:
workflow_call:
outputs:
intigration-tests:
description: 'unit test results'
value: ${{jobs.integration-tests.result}}
inputs:
commit:
required: true
type: string
workflow_dispatch: {}

jobs:
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout Lit Actions
uses: actions/checkout@v4
id: checkout
with:
fetch-depth: 0
repository: LIT-Protocol/lit-assets
ref: ${{inputs.commit}}
token: ${{secrets.GH_PAT}}
path: ${{ github.workspace }}/lit-assets/
submodules: false
sparse-checkout: |
blockchain
rust/lit-node
- name: Check LA dir
run: ls -la ${{github.workspace}}/lit-assets
- name: Setup Lit Bockchain Dependencies
uses: buildjet/setup-node@v3
with:
node-version: 20
cache: npm
cache-dependency-path: ${{ github.workspace }}/lit-assets/blockchain/contracts/package-lock.json
- name: Install Blockchain Deps
run: npm i
working-directory: ${{github.workspace}}/lit-assets/blockchain/contracts
- name: Docker login
id: login
run: docker login ghcr.io/ -u ${{secrets.GH_USER}} --password ${{secrets.GH_PAT}}
- name: Pull Shiva Container
id: shiva-pull
run: docker pull ghcr.io/lit-protocol/shiva:latest
- name: Run Shiva Container
id: shiva-runner
run: docker run -d -m 32g -p 8000:8000 -p 8545:8545 -p 7470:7470 -p 7471:7471 -p 7472:7472 -p 7473:7473 -p 7474:7474 -p 7475:7475 -v ${{github.workspace}}/lit-assets:/data -e GH_PAT=${{secrets.GH_PAT}} -e HASH=${{inputs.commit}} -e IPFS_API_KEY=${{secrets.IPFS_API_KEY}} --name shiva ghcr.io/lit-protocol/shiva:latest
- name: Install project dependencies
run: yarn
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'master'
- name: Build packages
id: build
run: yarn build:dev
- name: Copy ENV File
run: cp .env.ci .env
- name: End to End Tests
id: e2e-tests
if: steps.build.outputs.exit_code == 0
run: yarn test:e2e:ci:epoch
- name: Get Container Logs
if: always()
run: docker logs shiva
- name: Post Pull Shiva Container
id: container-stop
if: steps.shiva-pull.outputs.exit_code == 0
run: docker stop shiva && docker rm shiva
- name: Post Pull Shiva Image
if: steps.shiva-pull.outputs.exit_code == 0
run: docker rmi ghcr.io/lit-protocol/shiva
2 changes: 1 addition & 1 deletion .github/workflows/intigration-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Intigration Testing
name: Intigration Testing Datil
on:
workflow_call:
outputs:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/master-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ jobs:
intigration_tests:
uses: ./.github/workflows/intigration-test.yml
secrets: inherit
needs: [lint, get_shas, set_network_commit_hashes]
if: ${{needs.list_changed_files_and_trigger_workflows.outputs.lit_core_changed == 'true'}}
needs: [lint, get_shas, list_changed_files_and_trigger_workflows, set_network_commit_hashes]
with:
commit: ${{vars.DATIL_COMMIT_HASH}}
commit: ${{vars.DATIL_COMMIT_HASH}}
intigration_tests_longrun_epoch:
uses: ./.github/workflows/intigration-test-long-running.yml
secrets: inherit
needs: [lint, get_shas, set_network_commit_hashes]
with:
commit: ${{vars.DATIL_COMMIT_HASH}}
all_jobs:
if: ${{ always() }}
needs: [
Expand Down

0 comments on commit df93e46

Please sign in to comment.