diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bb236c1b0..8238cbfbf 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,46 +14,9 @@ env: THIS_FILE: .github/workflows/continuous-integration.yml jobs: - ######################## - # Tests and formating # - ######################## - - FormattingAndLinting: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - token: ${{ secrets.GH_TOKEN }} - - name: Format with clang-format (Cpp) - run: sudo apt install moreutils && .github/workflows/scripts/format_cpp.sh - - name: Format with cmake-format (Cmake) - run: pip3 install cmakelang && .github/workflows/scripts/format_cmake.sh - - name: Format with black (Python) - run: | - cd compiler - pip install -r lib/Bindings/Python/requirements_dev.txt - make check-python-format - - name: Lint with pylint (Python) - run: | - cd compiler - # compiler requirements to lint - pip install numpy - make python-lint - - name: Format with rustfmt (Rust) - run: | - cd compiler - make check-rust-format - - name: Linelint - uses: fernandrone/linelint@0.0.4 - id: linelint - - CheckLicense: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Check if sources include the license header - run: .github/workflows/scripts/check_for_license.sh + ##################### + # Build and testing # + ##################### BuildAndTestMacOS: runs-on: macos-11 diff --git a/.github/workflows/format_and_linting.yml b/.github/workflows/format_and_linting.yml new file mode 100644 index 000000000..14da62eb0 --- /dev/null +++ b/.github/workflows/format_and_linting.yml @@ -0,0 +1,47 @@ +name: Check format and run linters + +on: + push: + branches: [main, test-ci] + tags: + - 'v*' + pull_request: + types: [opened, synchronize, reopened] + +jobs: + FormattingAndLinting: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + token: ${{ secrets.GH_TOKEN }} + - name: Format with clang-format (Cpp) + run: sudo apt install moreutils && .github/workflows/scripts/format_cpp.sh + - name: Format with cmake-format (Cmake) + run: pip3 install cmakelang && .github/workflows/scripts/format_cmake.sh + - name: Format with black (Python) + run: | + cd compiler + pip install -r lib/Bindings/Python/requirements_dev.txt + make check-python-format + - name: Lint with pylint (Python) + run: | + cd compiler + # compiler requirements to lint + pip install numpy + make python-lint + - name: Format with rustfmt (Rust) + run: | + cd compiler + make check-rust-format + - name: Linelint + uses: fernandrone/linelint@0.0.4 + id: linelint + + CheckLicense: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Check if sources include the license header + run: .github/workflows/scripts/check_for_license.sh