| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- name: Build tests
- on:
- push:
- branches:
- - main
- pull_request:
- workflow_dispatch:
- jobs:
- repolinter:
- name: Repolinter
- runs-on: ubuntu-20.04
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- - name: Run repolinter
- run: npx repolinter --rulesetUrl https://raw.githubusercontent.com/hyperledger-labs/hyperledger-community-management-tools/master/repo_structure/repolint.json
- lints:
- name: Lints
- runs-on: ubuntu-20.04
- container: ghcr.io/hyperledger-labs/solang:ci
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- - name: Rust stable
- run: rustup default stable
- - name: Run cargo fmt
- run: cargo fmt --all -- --check
- - name: Run cargo clippy
- run: cargo clippy --workspace --tests --bins -- -D warnings -D clippy::inconsistent-struct-constructor
- docs:
- name: Docs
- runs-on: ubuntu-latest
- container: ubuntu:22.04
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- - name: Install sphinx
- run: |
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get install -y python3-sphinx python3-sphinx-rtd-theme
- - name: Build docs
- run: make html
- working-directory: docs
- linux-x86-64:
- name: Linux x86-64
- runs-on: ubuntu-20.04
- container: ghcr.io/hyperledger-labs/solang:ci
- steps:
- - name: Checkout sources
- # Make sure "git describe --tags" works for solang --version
- # checkout@v2 requires git 2.18 or higher, which is not in our image
- uses: actions/checkout@v1
- with:
- submodules: recursive
- - name: Rust stable
- run: rustup default 1.59.0
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose --workspace
- - uses: actions/upload-artifact@master
- with:
- name: solang-linux-x86-64
- path: ./target/debug/solang
- linux-arm:
- name: Linux Arm
- runs-on: linux-arm64
- # Don't run linux-arm64 on pull requests, it takes 38 minutes and only has one runner
- if: ${{ github.repository_owner == 'hyperledger-labs' && github.ref == 'refs/heads/main' }}
- container: ghcr.io/hyperledger-labs/solang:ci
- steps:
- - name: Checkout sources
- # Make sure "git describe --tags" works for solang --version
- # checkout@v2 requires git 2.18 or higher, which is not in our image
- uses: actions/checkout@v1
- with:
- submodules: recursive
- - name: Rust stable
- run: rustup default 1.59.0
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose --workspace
- - uses: actions/upload-artifact@master
- with:
- name: solang-linux-arm64
- path: ./target/debug/solang
- windows:
- name: Windows
- runs-on: windows-latest
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- with:
- # Make sure "git describe --tags" works for solang --version
- fetch-depth: 0
- submodules: recursive
- - name: Download LLVM
- run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-labs/solang/releases/download/v0.1.11/llvm13.0-win.zip
- - name: Extract LLVM
- run: unzip c:\llvm.zip -d c:/
- - name: Add LLVM to Path
- run: echo "c:\llvm13.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
- - name: Stable with rustfmt and clippy
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: stable
- components: clippy
- # We run clippy on Linux in the lint job above, but this does not check #[cfg(windows)] items
- - name: Run cargo clippy
- run: cargo clippy --workspace --tests --bins -- -D warnings -D clippy::inconsistent-struct-constructor
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose --workspace
- - uses: actions/upload-artifact@master
- with:
- name: solang.exe
- path: ./target/debug/solang.exe
- mac-arm:
- name: Mac Arm
- runs-on: macos-arm
- if: ${{ github.repository_owner == 'hyperledger-labs' }}
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- with:
- # Make sure "git describe --tags" works for solang --version
- fetch-depth: 0
- submodules: recursive
- - name: Download LLVM
- run: curl -L --output llvm13.0-mac-arm.tar.xz https://github.com/hyperledger-labs/solang/releases/download/v0.1.11/llvm13.0-mac-arm.tar.xz
- - name: Extract LLVM
- run: tar Jxf llvm13.0-mac-arm.tar.xz
- - name: Add LLVM to Path
- run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose --workspace
- - uses: actions/upload-artifact@master
- with:
- name: solang-mac-arm
- path: ./target/debug/solang
- mac-intel:
- name: Mac Intel
- runs-on: macos-latest
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- with:
- # Make sure "git describe --tags" works for solang --version
- fetch-depth: 0
- submodules: recursive
- - name: Download LLVM
- run: wget -q -O llvm13.0-mac-intel.tar.xz https://github.com/hyperledger-labs/solang/releases/download/v0.1.11/llvm13.0-mac-intel.tar.xz
- - name: Extract LLVM
- run: tar Jxf llvm13.0-mac-intel.tar.xz
- - name: Add LLVM to Path
- run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose --workspace
- - uses: actions/upload-artifact@master
- with:
- name: solang-mac-intel
- path: ./target/debug/solang
- image-multiarch:
- name: Multiarch Container Image
- runs-on: macos-arm
- if: ${{ github.repository_owner == 'hyperledger-labs' }}
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- with:
- # Make sure "git describe --tags" works for solang --version
- fetch-depth: 0
- - run: echo "::set-output name=push::--push"
- id: push
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- - run: |
- echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- docker buildx build . \
- ${{steps.push.outputs.push}} \
- -t ghcr.io/${GITHUB_REPOSITORY}:latest \
- --platform linux/arm64,linux/amd64 \
- --label org.opencontainers.image.description="Solidity Compiler for Solana, Substrate, and ewasm version $(git describe --tags)"
- image:
- name: Container Image
- runs-on: ubuntu-20.04
- if: ${{ github.repository_owner != 'hyperledger-labs' }}
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- with:
- # Make sure "git describe --tags" works for solang --version
- fetch-depth: 0
- - run:
- docker build .
- -t ghcr.io/${GITHUB_REPOSITORY}:latest
- --label org.opencontainers.image.description="Solidity Compiler for Solana, Substrate, and ewasm version $(git describe --tags)"
- solana:
- name: Solana Integration test
- runs-on: ubuntu-20.04
- container: ubuntu:20.04
- needs: linux-x86-64
- services:
- solana:
- image: solanalabs/solana:v1.9.15
- ports:
- - 8899
- - 8900
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- - uses: actions/setup-node@v1
- with:
- node-version: '14'
- - uses: actions/download-artifact@master
- with:
- name: solang-linux-x86-64
- path: bin
- - run: |
- chmod 755 ./bin/solang
- echo "$(pwd)/bin" >> $GITHUB_PATH
- - run: npm install
- working-directory: ./integration/solana
- - name: Build Solang contracts
- run: npm run build
- working-directory: ./integration/solana
- - name: Set github env
- run: echo "RPC_URL=http://solana:8899/" >> $GITHUB_ENV
- - name: Deploy and test contracts
- run: npm run test
- working-directory: ./integration/solana
- substrate:
- name: Substrate Integration test
- runs-on: ubuntu-20.04
- needs: linux-x86-64
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- # We can't run substrate as a github actions service, since it requires
- # command line arguments. See https://github.com/actions/runner/pull/1152
- - name: Start substrate
- run: docker run -d -p 9944:9944 parity/substrate:v3.0.0 --dev --ws-external
- - uses: actions/setup-node@v1
- with:
- node-version: '14'
- - uses: actions/download-artifact@master
- with:
- name: solang-linux-x86-64
- path: bin
- - run: |
- chmod 755 ./bin/solang
- echo "$(pwd)/bin" >> $GITHUB_PATH
- - run: npm install
- working-directory: ./integration/substrate
- - name: Build Solang contracts
- run: npm run build
- working-directory: ./integration/substrate
- - name: Deploy and test contracts
- run: npm run test
- working-directory: ./integration/substrate
- burrow:
- name: Burrow Integration test
- runs-on: ubuntu-20.04
- container: ubuntu:20.04
- needs: linux-x86-64
- services:
- burrow:
- image: hyperledger/burrow:0.34.4
- ports:
- - 10997
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- - uses: actions/setup-node@v1
- with:
- node-version: '14'
- - uses: actions/download-artifact@master
- with:
- name: solang-linux-x86-64
- path: bin
- - run: |
- chmod 755 ./bin/solang
- echo "$(pwd)/bin" >> $GITHUB_PATH
- - run: npm install
- working-directory: ./integration/burrow
- - name: Build Solang contract
- run: npm run build
- working-directory: ./integration/burrow
- - name: Set github env
- run: echo "RPC_URL=burrow:10997" >> $GITHUB_ENV
- - name: Deploy and test contract
- run: npm run test
- working-directory: ./integration/burrow
- vscode:
- name: Visual Code Extension
- runs-on: ubuntu-20.04
- needs: linux-x86-64
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - uses: actions/download-artifact@master
- with:
- name: solang-linux-x86-64
- path: bin
- - run: |
- chmod 755 ./bin/solang
- echo "$(pwd)/bin" >> $GITHUB_PATH
- - name: Install Node.js
- uses: actions/setup-node@v1
- with:
- node-version: '14'
- - run: npm install
- working-directory: ./vscode
- - run: npm run compile
- working-directory: ./vscode
- - name: Run headless test
- uses: GabrielBB/xvfb-action@v1
- with:
- working-directory: ./vscode
- run: npm test
- - run: npm install -g vsce
- working-directory: ./vscode
- - run: vsce package
- working-directory: ./vscode
|