fix: ci tests #376
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ⛓️ Builds and Tests @nibiruchain/ts-sdk | |
on: | |
pull_request: | |
branches: ["develop", "main"] | |
push: | |
branches: ["main"] | |
jobs: | |
checkout_cache_install_build_test: | |
runs-on: ubuntu-latest | |
env: | |
VALIDATOR_MNEMONIC: ${{ secrets.VALIDATOR_MNEMONIC }} | |
VALIDATOR_ADDRESS: ${{ secrets.VALIDATOR_ADDRESS }} | |
LCD_ENDPOINT: "http://127.0.0.1:1317" | |
GRPC_ENDPOINT: "127.0.0.1:9090" | |
TENDERMINT_RPC_ENDPOINT: "http://127.0.0.1:26657" | |
USE_LOCALNET: true | |
WEBSOCKET_ENDPOINT: "ws://127.0.0.1:26657/websocket" | |
CHAIN_ID: "nibiru-localnet-0" | |
ROCKSDB_VERSION: "8.9.1" | |
NIBIRU_VERSION: "latest" | |
steps: | |
- name: Checkout ts-sdk Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Checkout nibiru Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
repository: NibiruChain/nibiru | |
ref: main | |
path: "nibiru" | |
token: ${{ secrets.NIBIBOT_GIT_TOKEN }} | |
- name: Setup NodeJS with yarn caching | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "lts/hydrogen" | |
cache: "yarn" | |
cache-dependency-path: "**/yarn.lock" | |
- name: yarn install | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install | |
- name: yarn build | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: build | |
# - name: Login to GitHub Container Registry | |
# uses: docker/login-action@v3 | |
# with: | |
# registry: ghcr.io | |
# username: nibibot | |
# password: ${{ secrets.NIBIBOT_GIT_TOKEN }} | |
# - name: Run Nibiru network in the background | |
# run: | | |
# cd nibiru | |
# make chaosnet | |
# cd .. | |
# Install and run chain | |
- name: Get path to temp-dir for the cache step. | |
id: cache-temp-dir | |
run: | | |
echo "CACHE_TEMP_DIR=$(pwd)/temp-${{ env.ROCKSDB_VERSION }}" >> $GITHUB_ENV | |
- name: Cache the rocksdb and other dependencies | |
id: go-hm-deps | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CACHE_TEMP_DIR }} | |
key: ${{ runner.os }}-go-hm-deps | |
- name: Install Linux deps | |
run: | | |
make install-linux-deps | |
- name: Install nibid | |
run: curl -s https://get.nibiru.fi/@${{ env.NIBIRU_VERSION }}! | bash | |
- name: run localnet | |
run: bash scripts/localnet.sh --no-build & | |
- name: Wait for 120 seconds | |
run: sleep 120 | |
# Run tests | |
- name: yarn test | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: test | |
- name: Jest Coverage Comment | |
uses: MishaKav/jest-coverage-comment@main | |
with: | |
coverage-summary-path: ./coverage/coverage-summary.json | |
- name: SonarQube Scan | |
uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
# Re-enable when we can reliable have green tests | |
# - name: "SonarQube Quality Gate" | |
# uses: sonarsource/sonarqube-quality-gate-action@master | |
# timeout-minutes: 5 | |
# env: | |
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |