diff --git a/.github/workflows/build-test-package.yaml b/.github/workflows/ci.yaml similarity index 70% rename from .github/workflows/build-test-package.yaml rename to .github/workflows/ci.yaml index 1ccdfa2..fb6b4b9 100644 --- a/.github/workflows/build-test-package.yaml +++ b/.github/workflows/ci.yaml @@ -1,10 +1,13 @@ -name: Build addon, run tests and package +name: CI on: [push, pull_request] +env: + CI: true + jobs: build-and-test: - name: Build addon + name: Build addon and run tests runs-on: ${{ matrix.os }} strategy: matrix: @@ -86,9 +89,6 @@ jobs: - name: Move addons to one folder run: mkdir prebuilds && mv ./addon-*/* ./prebuilds/ - - name: list - run: find prebuilds - - name: Build package run: make package @@ -100,4 +100,43 @@ jobs: uses: actions/upload-artifact@v1 with: name: package - path: secp256k1-${{ steps.pkg-version.outputs.version }}.tgz + path: keccak-${{ steps.pkg-version.outputs.version }}.tgz + + lint-cpp: + name: Lint C/C++ code + runs-on: ubuntu-latest + steps: + - name: Fetch code + uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - uses: actions/cache@v1 + id: cache + with: + path: clang + key: clang-llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 + + - name: Download clang-format + if: steps.cache.outputs.cache-hit != 'true' + run: wget -O- -q http://releases.llvm.org/9.0.0/$VER.tar.xz | tar xfJ - $VER/bin/clang-format && mv $VER clang + env: + VER: clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 + + - name: Run lint command + run: PATH=$PATH:./clang/bin/ make lint-cpp-ci + + lint-js: + name: Lint JS code + runs-on: ubuntu-latest + steps: + - name: Fetch code + uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Install dependencies + run: yarn install --ignore-scripts + + - name: Run lint command + run: make lint-js diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index af60bf8..0000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Lint C/C++ and JS code - -on: [push, pull_request] - -jobs: - cpp: - name: Lint C/C++ code - runs-on: ubuntu-latest - steps: - - name: Fetch code - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - - uses: actions/cache@v1 - id: cache - with: - path: clang - key: clang-llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 - - - name: Download clang-format - if: steps.cache.outputs.cache-hit != 'true' - run: wget -O- -q http://releases.llvm.org/9.0.0/$VER.tar.xz | tar xfJ - $VER/bin/clang-format && mv $VER clang - env: - VER: clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 - - - name: Run lint command - run: PATH=$PATH:./clang/bin/ make lint-cpp-ci - - js: - name: Lint JS code - runs-on: ubuntu-latest - steps: - - name: Fetch code - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - - name: Install dependencies - run: yarn install --ignore-scripts - - - name: Run lint command - run: make lint-js