Skip to content

Commit

Permalink
ci: fix cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrayz authored and ccrayz committed Jun 14, 2024
1 parent 79b7a53 commit 83f3360
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 147 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,32 +73,3 @@ jobs:
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v5.2.2-beta
RELEASE_VERSION=5.2.2
cd:
needs: ci
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-latest
steps:
- name: Checkout Target Repository
uses: actions/checkout@v3
with:
repository: kroma-network/devops-helm
ref: main
token: ${{ secrets.KROMA_GIT_TOKEN }}

- name: Update Image Tag
uses: mikefarah/yq@master
with:
cmd: |
yq -i '.backend.image.tag = "${{ needs.ci.outputs.IMAGE_TAG }}"' '${{ env.NAMESPACE }}/${{ env.APP_NAME }}/${{ secrets.CLUSTER }}.yaml'
- name: Push Changed Image Tag
run: |
git config --global user.email lightscale@lightscale.io
git config --global user.name lightscale
if [ -z "$(git status --porcelain)" ]
then
echo "Nothing to commit, working directory clean"
else
git commit -am "${{ env.APP_NAME }} ${{ needs.ci.outputs.IMAGE_TAG }}" && git push
fi
220 changes: 102 additions & 118 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@ on:
push:
branches:
- master
- production-arbitrum
- production-core
- production-eth-sepolia
- production-filecoin
- production-fuse
- production-optimism
- production-immutable
- production-iota
- production-lukso
- production-rsk
- production-sokol
- production-suave
- production-xdai
- production-zkevm
- production-zksync
- staging-l2
paths-ignore:
- 'CHANGELOG.md'
- '**/README.md'
Expand Down Expand Up @@ -49,7 +33,7 @@ jobs:
// Add/remove CI matrix chain types here
const defaultChainTypes = ["default"];
const chainTypes = ["ethereum", "polygon_zkevm", "rsk", "stability", "filecoin", "optimism", "arbitrum"];
const chainTypes = ["ethereum", "optimism"];
const extraChainTypes = ["suave", "polygon_edge"];
// Chain type matrix we use in master branch
Expand Down Expand Up @@ -649,104 +633,104 @@ jobs:
ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox"
CHAIN_TYPE: ${{ matrix.chain-type != 'default' && matrix.chain-type || '' }}
WETH_TOKEN_TRANSFERS_FILTERING_ENABLED: "true"
test_nethermind_mox_block_scout_web:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix-builder.outputs.matrix) }}
name: Blockscout Web Tests
runs-on: ubuntu-latest
needs:
- build-and-cache
- matrix-builder
services:
redis-db:
image: "redis:alpine"
ports:
- 6379:6379

postgres:
image: postgres:15
env:
# Match apps/explorer/config/test.exs config :explorer, Explorer.Repo, database
POSTGRES_DB: explorer_test
# match PGPASSWORD for elixir image above
POSTGRES_PASSWORD: postgres
# match PGUSER for elixir image above
POSTGRES_USER: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
hexpm-mirrors: |
https://builds.hex.pm
https://cdn.jsdelivr.net/hex
- name: Mix Deps Cache
uses: actions/cache/restore@v4
id: deps-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-
- name: Restore Explorer NPM Cache
uses: actions/cache@v4
id: explorer-npm-cache
with:
path: apps/explorer/node_modules
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-${{ hashFiles('apps/explorer/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-
- name: Restore Blockscout Web NPM Cache
uses: actions/cache@v4
id: blockscoutweb-npm-cache
with:
path: apps/block_scout_web/assets/node_modules
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-${{ hashFiles('apps/block_scout_web/assets/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-
- name: Build assets
run: node node_modules/webpack/bin/webpack.js --mode development
working-directory: "apps/block_scout_web/assets"

- run: ./bin/install_chrome_headless.sh

- name: mix test --exclude no_nethermind
run: |
mix ecto.create --quiet
mix ecto.migrate
cd apps/block_scout_web
mix compile
mix test --no-start --exclude no_nethermind
env:
# match POSTGRES_PASSWORD for postgres image below
PGPASSWORD: postgres
# match POSTGRES_USER for postgres image below
PGUSER: postgres
ETHEREUM_JSONRPC_CASE: "EthereumJSONRPC.Case.Nethermind.Mox"
ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox"
CHAIN_ID: "10200"
API_RATE_LIMIT_DISABLED: "true"
API_GRAPHQL_RATE_LIMIT_DISABLED: "true"
ADMIN_PANEL_ENABLED: "true"
ACCOUNT_ENABLED: "true"
ACCOUNT_REDIS_URL: "redis://localhost:6379"
SOURCIFY_INTEGRATION_ENABLED: "true"
CHAIN_TYPE: ${{ matrix.chain-type != 'default' && matrix.chain-type || '' }}
WETH_TOKEN_TRANSFERS_FILTERING_ENABLED: "true"
# test_nethermind_mox_block_scout_web:
# strategy:
# fail-fast: false
# matrix: ${{ fromJson(needs.matrix-builder.outputs.matrix) }}
# name: Blockscout Web Tests
# runs-on: ubuntu-latest
# needs:
# - build-and-cache
# - matrix-builder
# services:
# redis-db:
# image: "redis:alpine"
# ports:
# - 6379:6379

# postgres:
# image: postgres:15
# env:
# # Match apps/explorer/config/test.exs config :explorer, Explorer.Repo, database
# POSTGRES_DB: explorer_test
# # match PGPASSWORD for elixir image above
# POSTGRES_PASSWORD: postgres
# # match PGUSER for elixir image above
# POSTGRES_USER: postgres
# # Set health checks to wait until postgres has started
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# # Maps tcp port 5432 on service container to the host
# - 5432:5432
# steps:
# - uses: actions/checkout@v4
# - uses: erlef/setup-beam@v1
# with:
# otp-version: ${{ env.OTP_VERSION }}
# elixir-version: ${{ env.ELIXIR_VERSION }}
# hexpm-mirrors: |
# https://builds.hex.pm
# https://cdn.jsdelivr.net/hex

# - name: Mix Deps Cache
# uses: actions/cache/restore@v4
# id: deps-cache
# with:
# path: |
# deps
# _build
# key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-${{ hashFiles('mix.lock') }}
# restore-keys: |
# ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-

# - name: Restore Explorer NPM Cache
# uses: actions/cache@v4
# id: explorer-npm-cache
# with:
# path: apps/explorer/node_modules
# key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-${{ hashFiles('apps/explorer/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-

# - name: Restore Blockscout Web NPM Cache
# uses: actions/cache@v4
# id: blockscoutweb-npm-cache
# with:
# path: apps/block_scout_web/assets/node_modules
# key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-${{ hashFiles('apps/block_scout_web/assets/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-

# - name: Build assets
# run: node node_modules/webpack/bin/webpack.js --mode development
# working-directory: "apps/block_scout_web/assets"

# - run: ./bin/install_chrome_headless.sh

# - name: mix test --exclude no_nethermind
# run: |
# mix ecto.create --quiet
# mix ecto.migrate
# cd apps/block_scout_web
# mix compile
# mix test --no-start --exclude no_nethermind
# env:
# # match POSTGRES_PASSWORD for postgres image below
# PGPASSWORD: postgres
# # match POSTGRES_USER for postgres image below
# PGUSER: postgres
# ETHEREUM_JSONRPC_CASE: "EthereumJSONRPC.Case.Nethermind.Mox"
# ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox"
# CHAIN_ID: "10200"
# API_RATE_LIMIT_DISABLED: "true"
# API_GRAPHQL_RATE_LIMIT_DISABLED: "true"
# ADMIN_PANEL_ENABLED: "true"
# ACCOUNT_ENABLED: "true"
# ACCOUNT_REDIS_URL: "redis://localhost:6379"
# SOURCIFY_INTEGRATION_ENABLED: "true"
# CHAIN_TYPE: ${{ matrix.chain-type != 'default' && matrix.chain-type || '' }}
# WETH_TOKEN_TRANSFERS_FILTERING_ENABLED: "true"

0 comments on commit 83f3360

Please sign in to comment.