From 3678707e2bfe36ee77a8130536d6a28f6eae2772 Mon Sep 17 00:00:00 2001 From: hjpotter92 Date: Fri, 2 Feb 2024 09:31:44 +0530 Subject: [PATCH] workflows: Rearrange github actions to be more streamlined - Rename `build` workflow to `test` (as it was only running tests) - Add check for validity of editorconfig - Rename file from `.yml` to `.yaml` --- .editorconfig | 8 +++ .github/workflows/build.yml | 35 ------------- .github/workflows/{git.yml => git.yaml} | 0 .github/workflows/test.yaml | 65 +++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/build.yml rename .github/workflows/{git.yml => git.yaml} (100%) create mode 100644 .github/workflows/test.yaml diff --git a/.editorconfig b/.editorconfig index 5d62e9ac..d5bf0dac 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,13 @@ root = true +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + [*.{js,sol}] indent_style = true indent_size = 4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index bbea1b22..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build -on: - pull_request: - push: - branches: - - delta - - confluence - - streamflow - - next - - master -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # Needed for commands that depend on git tags - fetch-depth: 0 - - name: Install dependencies - run: | - yarn - - name: Linter - run: | - yarn lint - - name: Compile contracts - run: | - yarn compile - - name: 💡 Run contract tests with coverage reporting - run: | - yarn test:coverage - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/git.yml b/.github/workflows/git.yaml similarity index 100% rename from .github/workflows/git.yml rename to .github/workflows/git.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..59eb98ed --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,65 @@ +name: Run test suite for the project + +on: + pull_request: + push: + branches: + - delta + - confluence + - streamflow + - next + - master + +jobs: + test: + name: Test with coverage + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + # Check https://github.com/livepeer/go-livepeer/pull/1891 + # for ref value discussion + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/setup-node@v3 + with: + node-version: "16" + cache: "yarn" + + - name: Install dependencies + run: yarn install + + - name: Run linter + run: yarn lint + + - name: Compile contracts + run: yarn compile + + - name: 💡 Run contract tests with coverage reporting + run: yarn test:coverage + + - name: Upload coverage reports + uses: codecov/codecov-action@v3 + with: + files: ./coverage/lcov.info + name: protocol + token: ${{ secrets.CI_CODECOV_TOKEN }} + + editorconfig: + name: Run editorconfig checker + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4.1.1 + with: + # Check https://github.com/livepeer/go-livepeer/pull/1891 + # for ref value discussion + ref: ${{ github.event.pull_request.head.sha }} + + - name: Install editorconfig-checker + uses: editorconfig-checker/action-editorconfig-checker@main + + - name: Run editorconfig checker against the repo + run: editorconfig-checker