Skip to content

Commit

Permalink
ci: adjust solc version compile CI for new LSP8 pragma settings + run…
Browse files Browse the repository at this point in the history
… on any new commits to PR (#823)
  • Loading branch information
CJ42 authored Dec 6, 2023
1 parent 9b51780 commit e8b20c1
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/solc_version.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# This workflow ensure that the smart contracts can be compiled
# with different Solidity 0.8.x versions
# 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:

# Used to check pragma settings for `.sol` files are correct before releasing
push:
# Used to check before releasing
branches:
- "develop"
# compare gas diff only when editing Solidity smart contract code
# Only run when `.sol` files have been changed
paths:
- "contracts/**/*.sol"

pull_request:
types: [opened]

# compare gas diff only when editing Solidity smart contract code
paths:
- "contracts/**/*.sol"

Expand All @@ -43,6 +40,8 @@ jobs:
"0.8.19",
"0.8.20",
"0.8.21",
"0.8.22",
"0.8.23",
]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -71,11 +70,14 @@ jobs:
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 "Compatible" | grep -v "Extension4337") --allow-paths $(pwd)/node_modules/ \
solc $(ls contracts/**/*.sol | grep -v "Compatible\|Extension4337\|contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset") \
--allow-paths $(pwd)/node_modules/ \
@=node_modules/@ \
solidity-bytes-utils/=node_modules/solidity-bytes-utils/ \
../=$(pwd)/contracts/
Expand Down

0 comments on commit e8b20c1

Please sign in to comment.