feat: save user announcements to local storage and last fetched block #1259
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
# Etherscan API keys. | |
ARBISCAN_API_KEY: ${{ secrets.ARBISCAN_API_KEY }} | |
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} # Mainnet. | |
OPTIMISTIC_ETHERSCAN_API_KEY: ${{ secrets.OPTIMISTIC_ETHERSCAN_API_KEY }} | |
POLYGONSCAN_API_KEY: ${{ secrets.POLYGONSCAN_API_KEY }} | |
# Subgraphs | |
MAINNET_SUBGRAPH_URL: ${{ secrets.MAINNET_SUBGRAPH_URL }} | |
OPTIMISM_SUBGRAPH_URL: ${{ secrets.OPTIMISM_SUBGRAPH_URL }} | |
GNOSIS_CHAIN_SUBGRAPH_URL: ${{ secrets.GNOSIS_CHAIN_SUBGRAPH_URL }} | |
POLYGON_SUBGRAPH_URL: ${{ secrets.POLYGON_SUBGRAPH_URL }} | |
BASE_SUBGRAPH_URL: ${{ secrets.BASE_SUBGRAPH_URL }} | |
ARBITRUM_ONE_SUBGRAPH_URL: ${{ secrets.ARBITRUM_ONE_SUBGRAPH_URL }} | |
SEPOLIA_SUBGRAPH_URL: ${{ secrets.SEPOLIA_SUBGRAPH_URL }} | |
# Other. | |
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | |
POLYGON_RPC_URL: ${{ secrets.POLYGON_RPC_URL }} | |
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} | |
ARBITRUM_ONE_RPC_URL: ${{ secrets.ARBITRUM_ONE_RPC_URL }} | |
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }} | |
GNOSIS_CHAIN_RPC_URL: ${{ secrets.GNOSIS_CHAIN_RPC_URL }} | |
BASE_RPC_URL: $${{ secrets.BASE_RPC_URL }} | |
FOUNDRY_PROFILE: ci | |
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: volta-cli/action@v4 | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- run: yarn list | |
- run: yarn install --frozen-lockfile --verbose --network-concurrency 1 | |
- run: yarn build | |
- name: Upload frontend build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: frontend | |
path: | | |
frontend/dist/spa | |
fleek.config.json | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: volta-cli/action@v4 | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- run: yarn install --network-concurrency 1 | |
- name: Run tests | |
run: yarn test | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: volta-cli/action@v4 | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- run: yarn install | |
- name: Run coverage | |
run: yarn coverage | |
- name: Merge directories | |
run: | | |
sudo apt update && sudo apt install -y lcov | |
lcov \ | |
--add-tracefile ./contracts-periphery/lcov.info \ | |
--add-tracefile ./umbra-js/coverage/lcov.info \ | |
--output-file lcov.info \ | |
--rc lcov_branch_coverage=1 | |
# To ignore coverage for certain directories modify the paths in this step as needed. | |
# Alternatively, to include coverage in all directories, comment out this step. | |
- name: Filter directories | |
run: | | |
lcov --remove ./lcov.info 'contracts-periphery/test/*' 'contracts-periphery/script/*' \ | |
--output-file lcov.info \ | |
--rc lcov_branch_coverage=1 | |
# This step posts a detailed coverage report as a comment and deletes previous comments on | |
# each push. The below step is used to fail coverage if the specified coverage threshold is | |
# not met. The below step can post a comment (when it's `github-token` is specified) but it's | |
# not as useful, and this action cannot fail CI based on a minimum coverage threshold, which | |
# is why we use both in this way. | |
- name: Post coverage report | |
if: github.event_name == 'pull_request' # This action fails when ran outside of a pull request. | |
uses: romeovs/lcov-reporter-action@v0.3.1 | |
with: | |
delete-old-comments: true | |
lcov-file: ./lcov.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} # Adds a coverage summary comment to the PR. | |
- name: Verify minimum coverage | |
uses: zgosalvez/github-actions-report-lcov@v2 | |
with: | |
coverage-files: ./lcov.info | |
minimum-coverage: 70 # Set coverage threshold. | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: volta-cli/action@v4 | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install scopelint | |
uses: engineerd/configurator@v0.0.8 | |
with: | |
name: scopelint | |
repo: ScopeLift/scopelint | |
fromGitHubReleases: true | |
version: latest | |
pathInArchive: scopelint-x86_64-linux/scopelint | |
urlTemplate: https://github.com/ScopeLift/scopelint/releases/download/{{version}}/scopelint-x86_64-linux.tar.xz | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- run: yarn install | |
- name: Run yarn lint | |
run: yarn lint | |
- name: Run scopelint | |
run: | | |
cd contracts-periphery | |
scopelint --version | |
scopelint check | |
deploy-to-fleek: | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
env: | |
FLEEK_TOKEN: ${{ secrets.FLEEK_TOKEN }} | |
FLEEK_PROJECT_ID: ${{ secrets.FLEEK_PROJECT_ID }} | |
steps: | |
- name: Download frontend | |
uses: actions/download-artifact@v4 | |
with: | |
name: frontend | |
- uses: volta-cli/action@v4 | |
- name: Look at directory | |
run: ls -la | |
- name: Install Typescript | |
run: volta run yarn global add typescript@^4.0.3 | |
- name: Install Fleek CLI | |
run: volta run yarn global add @fleekxyz/cli | |
- name: Build & deploy sites | |
run: volta run fleek sites deploy |