Skip to content

Commit

Permalink
Merge pull request #14 from CamposBruno/fix/ci
Browse files Browse the repository at this point in the history
Diferent workflows for test/build/release
  • Loading branch information
CamposBruno authored Mar 28, 2024
2 parents 1d30b2e + d1f5271 commit c15b430
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 15 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Unit tests workflow
on: push

jobs:
build-test:
name: "Build and Test"
runs-on: ubuntu-latest
environment: testnet #change to mainnet before production

strategy:
matrix:
node-version: ['20.x']

env:
RPC_URL: ${{ secrets.RPC_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Yarn
run: npm install --global yarn

- name: Install Dependencies
run: yarn install

- name: Compile
run: yarn run compile

- name: Run Tests
run: yarn run test
27 changes: 12 additions & 15 deletions .github/workflows/ci.yml → .github/workflows/push_main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: CI

name: Export ABI workflow
on:
push:
branches:
- main
push:
branches:
- main

jobs:
build-test-deploy:
exports-abi:
name: "Export ABI's"
runs-on: ubuntu-latest
environment: testnet #change to mainnet before production

Expand All @@ -17,6 +17,7 @@ jobs:
env:
RPC_URL: ${{ secrets.RPC_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}


steps:
- uses: actions/checkout@v4
Expand All @@ -34,21 +35,17 @@ jobs:

- name: Compile
run: yarn run compile

- name: Run Tests
run: yarn run test


- name: Extract and publish ABIs
run: |
mkdir -p data/abis
find ./artifacts/contracts -type f -name "*.json" ! -name "*.dbg.json" -exec cp {} data/abis/ \;
mkdir -p data/abis
find ./artifacts/contracts -type f -name "*.json" ! -name "*.dbg.json" -exec cp {} data/abis/ \;
- name: Upload ABI
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_options: '--no-verify --signoff'
push_options: '--force'
file_pattern: './data/abis/*.json'

- name: Run Deploy
run: yarn run deploy --network testnet #change to mainnet before production

41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Workflow

on:
release:
types: [released]

jobs:
build-test-deploy:
runs-on: ubuntu-latest
environment: testnet #change to mainnet before production

strategy:
matrix:
node-version: ['20.x']

env:
RPC_URL: ${{ secrets.RPC_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Yarn
run: npm install --global yarn

- name: Install Dependencies
run: yarn install

- name: Compile
run: yarn run compile

- name: Run Tests
run: yarn run test

- name: Run Deploy
run: yarn run deploy --network testnet #change to mainnet before production

0 comments on commit c15b430

Please sign in to comment.