Skip to content

build!: move LSP8 in its own package #853

build!: move LSP8 in its own package

build!: move LSP8 in its own package #853

Workflow file for this run

# This workflow ensure that the smart contracts can be compiled with different Solidity 0.8.x versions
# It checks if the `pragma solidity ^0.8.x` statement for `.sol` files satisfy the minimum version
# require by the Solidity language features used in this file.
name: Solidity Compiler Versions
on:
workflow_dispatch:
push:
# Used to check before releasing
branches:
- "develop"
# Only run when `.sol` files have been changed
paths:
- "contracts/**/*.sol"
pull_request:
paths:
- "contracts/**/*.sol"
jobs:
solc_version:
runs-on: ubuntu-latest
strategy:
matrix:
solc: [
"0.8.5",
"0.8.6",
"0.8.7",
"0.8.8",
"0.8.9",
"0.8.10",
"0.8.11",
"0.8.12",
"0.8.13",
"0.8.14",
"0.8.15",
"0.8.16",
# 0.8.17 skipped as default in hardhat.config.ts
"0.8.18",
"0.8.19",
"0.8.20",
"0.8.21",
"0.8.22",
"0.8.23",
]
steps:
- uses: actions/checkout@v3
- name: Use Node.js '16.15.0'
uses: actions/setup-node@v2
with:
node-version: "16.15.0"
cache: "npm"
- name: 📦 Install dependencies
run: npm ci
- name: Install solc-select
run: pip3 install solc-select
- name: Use Solc v${{ matrix.solc }}
run: |
solc-select install ${{ matrix.solc }}
solc-select use ${{ matrix.solc }}
- name: Compare versions to filter contracts to compile
uses: madhead/semver-utils@latest
id: comparison
with:
version: ${{ matrix.solc }}
compare-to: 0.8.12
# In the pattern matching of the `grep` command below, we use a path for LSP8 contracts with `pragma solidity ^0.8.12`
# instead of just the word "LSP8IdentifiableDigitalAsset" to prevent the whole `contracts/LSP8IdentifiableDigitalAsset/**/*.sol` folder from being discarded.
- name: Compile Smart Contracts
run: |
if [[ "<" == "${{ steps.comparison.outputs.comparison-result }}" ]]
then
solc $(ls contracts/**/*.sol | grep -v "Extension4337\|contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset") \
--allow-paths $(pwd)/node_modules/,$(pwd)/packages/ \
@=node_modules/@ \
solidity-bytes-utils/=node_modules/solidity-bytes-utils/ \
../=$(pwd)/contracts/ \
lsp0/=packages/LSP0ERC725Account/ \
lsp1/=packages/LSP1UniversalReceiver/ \
lsp2/=packages/LSP2ERC725YJSONSchema/ \
lsp4/=packages/LSP4DigitalAssetMetadata/ \
lsp5/=packages/LSP5ReceivedAssets/ \
lsp6/=packages/LSP6KeyManager/ \
lsp7/=packages/LSP7DigitalAsset/ \
lsp8/=packages/LSP8IdentifiableDigitalAsset/ \
lsp10/=packages/LSP10ReceivedVaults/ \
lsp14/=packages/LSP14Ownable2Step/ \
lsp17contractextension/=packages/LSP17ContractExtension/ \
lsp20/=packages/LSP20CallVerification/ \
lsp25/=packages/LSP25ExecuteRelayCall/
else
solc contracts/**/*.sol \
@=node_modules/@ \
solidity-bytes-utils/=node_modules/solidity-bytes-utils/ \
lsp0/=packages/LSP0ERC725Account/ \
lsp1/=packages/LSP1UniversalReceiver/ \
lsp2/=packages/LSP2ERC725YJSONSchema/ \
lsp4/=packages/LSP4DigitalAssetMetadata/ \
lsp5/=packages/LSP5ReceivedAssets/ \
lsp6/=packages/LSP6KeyManager/ \
lsp7/=packages/LSP7DigitalAsset/ \
lsp8/=packages/LSP8IdentifiableDigitalAsset/ \
lsp10/=packages/LSP10ReceivedVaults/ \
lsp14/=packages/LSP14Ownable2Step/ \
lsp17contractextension/=packages/LSP17ContractExtension/ \
lsp20/=packages/LSP20CallVerification/ \
lsp25/=packages/LSP25ExecuteRelayCall/
fi;