From e0e892ee21c13af07d65c97730c6b041b5fdba96 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 15 Dec 2021 18:11:40 +0100 Subject: [PATCH] simplify github workflows --- .github/workflows/lint-packages-dashboard.yml | 23 ++++++++++++ .../workflows/lint-packages-dnslink-api.yml | 23 ++++++++++++ .../workflows/lint-packages-handshake-api.yml | 23 ++++++++++++ .../workflows/lint-packages-health-check.yml | 23 ++++++++++++ .github/workflows/lint-packages-website.yml | 23 ++++++++++++ .github/workflows/lint-python.yml | 37 +++++++++++++++++++ 6 files changed, 152 insertions(+) create mode 100644 .github/workflows/lint-packages-dashboard.yml create mode 100644 .github/workflows/lint-packages-dnslink-api.yml create mode 100644 .github/workflows/lint-packages-handshake-api.yml create mode 100644 .github/workflows/lint-packages-health-check.yml create mode 100644 .github/workflows/lint-packages-website.yml create mode 100644 .github/workflows/lint-python.yml diff --git a/.github/workflows/lint-packages-dashboard.yml b/.github/workflows/lint-packages-dashboard.yml new file mode 100644 index 00000000..4a9fcc21 --- /dev/null +++ b/.github/workflows/lint-packages-dashboard.yml @@ -0,0 +1,23 @@ +name: Lint - packages/dashboard + +on: + pull_request: + paths: + - packages/dashboard/** + +defaults: + run: + working-directory: packages/dashboard + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.x + + - run: yarn + - run: yarn prettier --check . diff --git a/.github/workflows/lint-packages-dnslink-api.yml b/.github/workflows/lint-packages-dnslink-api.yml new file mode 100644 index 00000000..ea839f75 --- /dev/null +++ b/.github/workflows/lint-packages-dnslink-api.yml @@ -0,0 +1,23 @@ +name: Lint - packages/dnslink-api + +on: + pull_request: + paths: + - packages/dnslink-api/** + +defaults: + run: + working-directory: packages/dnslink-api + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.x + + - run: yarn + - run: yarn prettier --check . diff --git a/.github/workflows/lint-packages-handshake-api.yml b/.github/workflows/lint-packages-handshake-api.yml new file mode 100644 index 00000000..3e6404c6 --- /dev/null +++ b/.github/workflows/lint-packages-handshake-api.yml @@ -0,0 +1,23 @@ +name: Lint - packages/handshake-api + +on: + pull_request: + paths: + - packages/handshake-api/** + +defaults: + run: + working-directory: packages/handshake-api + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.x + + - run: yarn + - run: yarn prettier --check . diff --git a/.github/workflows/lint-packages-health-check.yml b/.github/workflows/lint-packages-health-check.yml new file mode 100644 index 00000000..afd5d96b --- /dev/null +++ b/.github/workflows/lint-packages-health-check.yml @@ -0,0 +1,23 @@ +name: Lint - packages/health-check + +on: + pull_request: + paths: + - packages/health-check/** + +defaults: + run: + working-directory: packages/health-check + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.x + + - run: yarn + - run: yarn prettier --check . diff --git a/.github/workflows/lint-packages-website.yml b/.github/workflows/lint-packages-website.yml new file mode 100644 index 00000000..795ed176 --- /dev/null +++ b/.github/workflows/lint-packages-website.yml @@ -0,0 +1,23 @@ +name: Lint - packages/website + +on: + pull_request: + paths: + - packages/website/** + +defaults: + run: + working-directory: packages/website + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.x + + - run: yarn + - run: yarn prettier --check . diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml new file mode 100644 index 00000000..330da3d3 --- /dev/null +++ b/.github/workflows/lint-python.yml @@ -0,0 +1,37 @@ +name: Lint - Python Scripts + +on: + push: + paths: + - "**.py" + +jobs: + black: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + architecture: x64 + + - run: pip install black + - run: black --check . + + flake8: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + architecture: x64 + + - run: pip install flake8 + + # E203: https://www.flake8rules.com/rules/E203.html - Whitespace before ':' + # E501: https://www.flake8rules.com/rules/E501.html - Line too long + # W503: https://www.flake8rules.com/rules/W503.html - Line break occurred before a binary operator + # W605: https://www.flake8rules.com/rules/W605.html - Invalid escape sequence + # E722: https://www.flake8rules.com/rules/E722.html - Do not use bare except, specify exception instead + - run: flake8 --max-line-length 88 --ignore E203,E501,W503,W605,E722