Skip to content

Commit

Permalink
ci: migrate from master to main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jhon287 committed Jun 9, 2023
1 parent 58fb6e6 commit 3d73727
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 42 deletions.
53 changes: 11 additions & 42 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,24 @@
---
name: BNPPF Parser Main CI/CD Pipelines

on:
push:
branches: [main]
paths-ignore: [README.md]
pull_request:
branches: [main]
paths-ignore: [README.md]

defaults:
run:
shell: bash

permissions: read-all

on:
push:
branches:
- master
- main
paths-ignore:
- README.md
pull_request:
branches:
- master
- main
paths-ignore:
- README.md

jobs:
syntax:
name: Check Syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Commitlint
uses: wagoid/commitlint-github-action@v5
with:
failOnWarnings: true

- name: Run YAMLlint
run: pip install --user yamllint && yamllint --strict .

- name: Install Flake8 and PyLint
run: pip install pylint flake8

- name: Run Flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
name: Syntax
uses: ./.github/workflows/syntax.yaml

tests:
name: Tests
Expand All @@ -65,10 +37,7 @@ jobs:
github.event_name == 'pull_request' ||
(
github.event_name == 'push' &&
(
github.ref != 'refs/heads/master' ||
github.ref != 'refs/heads/main'
)
github.ref != 'refs/heads/main'
)
}}
secrets:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/syntax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: BNPPF Parser Syntax Checks

on:
workflow_call:

permissions: read-all

jobs:
syntax:
name: Syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Commitlint
uses: wagoid/commitlint-github-action@v5
with:
failOnWarnings: true

- name: Run YAMLlint
run: pip install --user yamllint && yamllint --strict .

- name: Install Flake8 and PyLint
run: pip install pylint flake8

- name: Run Flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: BNPPF Parser Tests
on:
workflow_call:

permissions: read-all

jobs:
test:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 3d73727

Please sign in to comment.