-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from mlabs-haskell/setting-up-github-actions
Setting up GitHub actions
- Loading branch information
Showing
70 changed files
with
6,120 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Sequential Build of All Packages | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' # Adjust Node.js version as necessary | ||
|
||
- name: Build minauth | ||
run: | | ||
echo "Building minauth..." | ||
cd ./minauth | ||
npm install | ||
npm run build | ||
npm run test | ||
- name: Build minauth-erc721-timelock-plugin | ||
run: | | ||
echo "Building minauth-erc721-timelock-plugin..." | ||
cd ./minauth-plugins/minauth-erc721-timelock-plugin | ||
npm install-ci | ||
npm run build | ||
npm run test | ||
- name: Build minauth-merkle-membership-plugin | ||
run: | | ||
echo "Building minauth-merkle-membership-plugin..." | ||
cd ./minauth-plugins/minauth-merkle-membership-plugin | ||
npm install | ||
npm run build | ||
npm run test | ||
- name: Build minauth-simple-preimage-plugin | ||
run: | | ||
echo "Building minauth-simple-preimage-plugin..." | ||
cd ./minauth-plugins/minauth-simple-preimage-plugin | ||
npm install | ||
npm run build | ||
npm run test | ||
- name: Build minauth-demo-server | ||
run: | | ||
echo "Building minauth-demo-server..." | ||
cd ./minauth-demo/minauth-demo-server | ||
npm install | ||
npm run build | ||
npm run test | ||
- name: Build minauth-demo-client | ||
run: | | ||
echo "Building minauth-demo-client..." | ||
cd ./minauth-demo/minauth-demo-client | ||
npm install | ||
npm run dev-kill | ||
npm run test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build ERC-731 Plugin Package Workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install npm packages for this package and subpackages | ||
run: npm install-ci | ||
working-directory: minauth-plugins/minauth-erc721-timelock-plugin | ||
|
||
- name: Compile eth contracts & build the package using npm script | ||
run: npm run build | ||
working-directory: minauth-plugins/minauth-erc721-timelock-plugin | ||
env: | ||
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} | ||
SEPOLIA_PRIVATE_KEY: ${{ secrets.SEPOLIA_PRIVATE_KEY }} | ||
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Build All Packages | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-merkle-memberships-plugin: | ||
uses: ./.github/workflows/reusable-npm-build.yaml | ||
with: | ||
package_name: 'minauth-merkle-memberships-plugin' | ||
package_path: './minauth-plugins/minauth-merkle-memberships-plugin' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Build MinAuth Library | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-minauth-library: | ||
uses: ./.github/workflows/reusable-npm-build.yaml | ||
with: | ||
package_name: 'minauth' | ||
package_path: './minauth' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build Plugin Simple (NPM) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package_name: | ||
description: 'Name of the package' | ||
required: true | ||
default: 'default-package' | ||
package_path: | ||
description: 'Path to the package directory' | ||
required: true | ||
default: 'minauth-plugins/default-package' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' # Use the LTS version of Node.js | ||
|
||
- name: Cache Node.js modules for ${{ github.event.inputs.package_name }} | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies in ${{ github.event.inputs.package_name }} | ||
run: npm install | ||
working-directory: ${{ github.event.inputs.package_path }} | ||
|
||
- name: Build ${{ github.event.inputs.package_name }} | ||
run: npm run build | ||
working-directory: ${{ github.event.inputs.package_path }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Build All Packages | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-simple-preimage-plugin: | ||
uses: ./.github/workflows/reusable-npm-build.yaml | ||
with: | ||
package_name: 'minauth-simple-preimage-plugin' | ||
package_path: './minauth-plugins/minauth-simple-preimage-plugin' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Conditional Build on Trigger | ||
|
||
on: | ||
workflow_dispath: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y jq | ||
- name: Determine Builds | ||
id: determine-builds | ||
run: | | ||
# Initialize an empty array to hold packages that need building | ||
declare -A changed_packages | ||
# Check for changes in each package and update the list of packages that need building based on dependencies | ||
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -q './minauth'; then | ||
changed_packages["./minauth"]="minauth" | ||
fi | ||
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -q './minauth-plugins/minauth-erc721-timelock-plugin'; then | ||
changed_packages["./minauth-plugins/minauth-erc721-timelock-plugin"]="minauth-erc721-timelock-plugin" | ||
fi | ||
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -q './minauth-plugins/minauth-merkle-membership-plugin'; then | ||
changed_packages["./minauth-plugins/minauth-merkle-membership-plugin"]="minauth-merkle-membership-plugin" | ||
fi | ||
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -q './minauth-plugins/minauth-simple-preimage-plugin'; then | ||
changed_packages["./minauth-plugins/minauth-simple-preimage-plugin"]="minauth-simple-preimage-plugin" | ||
fi | ||
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -q './minauth-demo/minauth-demo-server'; then | ||
changed_packages["./minauth-demo/minauth-demo-server"]="minauth-demo-server" | ||
fi | ||
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -q './minauth-demo/minauth-demo-client'; then | ||
changed_packages["./minauth-demo/minauth-demo-client"]="minauth-demo-client" | ||
fi | ||
# Convert package paths to JSON array | ||
echo "::set-output name=packages::$(echo $(jq -nc '$ARGS.positional' --args "${!changed_packages[@]}"))" | ||
- name: Build packages | ||
run: | | ||
packages=(${{ steps.determine-builds.outputs.packages }}) | ||
for package in "${packages[@]}"; do | ||
echo "Building package: ${package}" | ||
cd $package | ||
npm install-ci | ||
npm run build | ||
cd - | ||
done | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Reusable Build Workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package_name: | ||
description: 'Name of the package' | ||
required: true | ||
type: string | ||
package_path: | ||
description: 'Path to the package directory' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' # Use the LTS version of Node.js | ||
|
||
- name: Cache Node.js modules for ${{ inputs.package_name }} | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install npm packages for this package and subpackages | ||
run: npm install-ci | ||
working-directory: ${{ inputs.package_path }} | ||
|
||
- name: Build the package using the 'build' npm script | ||
run: npm run build | ||
working-directory: ${{ inputs.package_path }} | ||
env: | ||
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} | ||
SEPOLIA_PRIVATE_KEY: ${{ secrets.SEPOLIA_PRIVATE_KEY }} | ||
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
# TypeChain output | ||
/typechain | ||
/typechain-types | ||
|
||
# Solidity coverage files | ||
/coverage | ||
|
15 changes: 8 additions & 7 deletions
15
minauth-plugins/minauth-erc721-timelock-plugin/eth-contract/hardhat.config.ts
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
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
9 changes: 9 additions & 0 deletions
9
...auth-erc721-timelock-plugin/eth-contract/typechain-types/@openzeppelin/contracts/index.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type * as interfaces from "./interfaces"; | ||
export type { interfaces }; | ||
import type * as token from "./token"; | ||
export type { token }; | ||
import type * as utils from "./utils"; | ||
export type { utils }; |
Oops, something went wrong.