Skip to content

Commit

Permalink
ci: fix validation pipeline and add paths
Browse files Browse the repository at this point in the history
  • Loading branch information
danijelTxFusion committed Feb 28, 2024
1 parent fc18f42 commit c0a9066
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 42 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/test-go.yml → .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Run tests Go
name: Go
on:
workflow_dispatch:
pull_request:
branch: main
branches: [main]
types: [ opened, reopened, synchronize ]
paths: [go]

permissions:
contents: read # for checkout
Expand All @@ -14,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
Expand All @@ -28,4 +29,16 @@ jobs:
docker-compose up -d
popd
- name: Run tests
run: cd go && make run-tests
run: cd go && make run-tests
lint:
name: Check code format for Go
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/[email protected]
- name: Run gofmt
run: cd go && make check-format
23 changes: 20 additions & 3 deletions .github/workflows/test-js.yml → .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,40 @@ name: Run tests JS
on:
workflow_dispatch:
pull_request:
branch: main
branches: [main]
types: [ opened, reopened, synchronize ]
paths: [js]

permissions:
contents: read # for checkout

jobs:
lint:
name: Check code format for JavaScript
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: cd js && yarn install
- name: Prepare environment
run: cd js && yarn lint:check
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
Expand Down
42 changes: 7 additions & 35 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,26 @@
name: Validate
on:
pull_request:
branch: main
branches: [main]
types: [ opened, reopened, synchronize ]

permissions:
contents: read # for checkout

jobs:
lint-go:
name: Check code format for Go
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Go
uses: actions/[email protected]
- name: Run gofmt
run: cd go && make check-format
lint-js:
name: Check code format for JavaScript
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: cd js && yarn install
- name: Prepare environment
run: cd js && yarn lint:check
commits:
name: Check commits
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install -g @commitlint/cli @commitlint/config-conventional
run: npm install -g @commitlint/cli@18.6.1 @commitlint/config-conventional@18.6.2
- name: Configure
run: |
echo 'module.exports = {"extends": ["@commitlint/config-conventional"]}' > commitlint.config.js
Expand All @@ -65,13 +37,13 @@ jobs:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install -g @commitlint/cli @commitlint/config-conventional
run: npm install -g @commitlint/cli@18.6.1 @commitlint/config-conventional@18.6.2
- name: Configure
run: |
echo 'module.exports = {"extends": ["@commitlint/config-conventional"]}' > commitlint.config.js
Expand Down

0 comments on commit c0a9066

Please sign in to comment.