Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): integrate yamllint and alejandra linters #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
name: Bug Report
description: Let us know about an issue you experienced with this software
labels: [I2-bug, I10-unconfirmed]

body:
- type: checkboxes
attributes:
label: Is there an existing issue?
description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue.
description:
Please search to see if an issue already exists and leave a comment
that you also experienced this issue or add your specifics that are related
to an existing issue.
options:
- label: I have searched the existing issues
required: true
Expand Down
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
blank_issues_enabled: true

contact_links:
- name: Support & Troubleshooting with Madara Community
url: https://t.me/madara
about: |
about: >-
For general problems with Madara or related technologies, please ask
and questions in our community! We highly encourage everyone also share their understanding by answering questions for others.
questions in our community! We highly encourage everyone to also share
their understanding by answering questions for others.
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Feature Request
description: Submit your requests and suggestions to improve!
labels: [I5-enhancement]
Expand All @@ -6,7 +7,10 @@ body:
id: existing
attributes:
label: Is there an existing issue?
description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue.
description:
Please search to see if an issue already exists and leave a comment
that you also experienced this issue or add your specifics that are related
to an existing issue.
options:
- label: I have searched the existing issues
required: true
Expand Down Expand Up @@ -39,9 +43,6 @@ body:
attributes:
label: Are you willing to help with this request?
multiple: true
options:
- Yes!
- No.
- Maybe (please elaborate above)
options: [Yes!, No., Maybe (please elaborate above)]
validations:
required: true
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
- package-ecosystem: cargo
directory: /
schedule:
interval: "weekly" # can be `daily` or `monthly` also
interval: weekly # can be `daily` or `monthly` also
open-pull-requests-limit: 10
115 changes: 56 additions & 59 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,84 @@
---
- name: "breaking-change"
- name: breaking-change
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we enforce some kind of spacing between sections for his kind of file?

color: ee0701
description: "A change that changes the API or breaks backward compatibility for users."
- name: "bump_db"
description:
A change that changes the API or breaks backward compatibility for
users.
- name: bump_db
color: ee0701
description: "Changes requiring a database version increment."
- name: "bugfix"
description: Changes requiring a database version increment.
- name: bugfix
color: ee0701
description:
"Inconsistencies or issues which will cause a problem for users or
implementors."
- name: "documentation"
description: Inconsistencies or issues which will cause a problem for users or
implementors.
- name: documentation
color: 0052cc
description: "Solely about the documentation of the project."
- name: "enhancement"
description: Solely about the documentation of the project.
- name: enhancement
color: 1d76db
description: "Enhancement of the code, not introducing new features."
- name: "refactor"
description: Enhancement of the code, not introducing new features.
- name: refactor
color: 1d76db
description:
"Updating the code with simpler, easier to understand or more efficient
syntax or methods, but not introducing new features."
- name: "performance"
Updating the code with simpler, easier to understand or more efficient
syntax or methods, but not introducing new features.
- name: performance
color: 1d76db
description: "Improving performance of the project, not introducing new features."
- name: "new-feature"
description: Improving performance of the project, not introducing new features.
- name: new-feature
color: 0e8a16
description: "New features or options."
- name: "maintenance"
description: New features or options.
- name: maintenance
color: 2af79e
description: "Generic maintenance tasks."
- name: "ci"
description: Generic maintenance tasks.
- name: ci
color: 1d76db
description: "Work that improves the continuous integration."
- name: "dependencies"
description: Work that improves the continuous integration.
- name: dependencies
color: 1d76db
description: "Change in project dependencies."

- name: "in-progress"
description: Change in project dependencies.
- name: in-progress
color: fbca04
description: "Issue is currently being worked on by a developer."
- name: "stale"
description: Issue is currently being worked on by a developer.
- name: stale
color: fef2c0
description: "No activity for quite some time."
- name: "no-stale"
description: No activity for quite some time.
- name: no-stale
color: fef2c0
description: "This is exempt from the stale bot."

- name: "security"
description: This is exempt from the stale bot.
- name: security
color: ee0701
description: "Addressing a vulnerability or security risk in this project."
- name: "incomplete"
description: Addressing a vulnerability or security risk in this project.
- name: incomplete
color: fef2c0
description: "Missing information."
- name: "invalid"
description: Missing information.
- name: invalid
color: fef2c0
description: "This is off-topic, spam, or otherwise doesn't apply to this project."

- name: "beginner-friendly"
description: This is off-topic, spam, or otherwise doesn't apply to this project.
- name: beginner-friendly
color: 0e8a16
description: "Good first issue for people wanting to contribute to this project."
- name: "help-wanted"
description: Good first issue for people wanting to contribute to this project.
- name: help-wanted
color: 0e8a16
description: "We need some extra helping hands or expertise in order to resolve this!"

- name: "priority-critical"
description: We need some extra helping hands or expertise in order to resolve
this!
- name: priority-critical
color: ee0701
description: "Must be addressed as soon as possible."
- name: "priority-high"
description: Must be addressed as soon as possible.
- name: priority-high
color: b60205
description:
"After critical issues are fixed, these should be dealt with before any
further issues."
- name: "priority-medium"
After critical issues are fixed, these should be dealt with before
any further issues.
- name: priority-medium
color: 0e8a16
description: "This issue may be useful, and needs some attention."
- name: "priority-low"
description: This issue may be useful, and needs some attention.
- name: priority-low
color: e4ea8a
description: "Nice addition, maybe... someday..."

- name: "major"
description: Nice addition, maybe... someday...
- name: major
color: b60205
description: "This PR causes a major bump in the version number."
- name: "minor"
description: This PR causes a major bump in the version number.
- name: minor
color: 0e8a16
description: "This PR causes a minor bump in the version number."
description: This PR causes a minor bump in the version number.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: Task - Build Madara
on:
"on":
workflow_dispatch:
workflow_call:
jobs:
build:
permissions:
pull-requests: write
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: rui314/setup-mold@v1
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.2"
scarb-version: 2.8.2
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
name: Task - Integration Tests

on:
"on":
workflow_dispatch:
workflow_call:
secrets:
ETH_FORK_URL:
required: true

jobs:
coverage:
permissions:
Expand All @@ -17,28 +16,35 @@ jobs:
- name: Setup build deps
run: |
sudo apt-get update
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler gcc g++ build-essential libssl-dev pkg-config curl wget git
sudo apt-get install -y \
clang \
llvm \
libudev-dev \
protobuf-compiler \
gcc \
g++ \
build-essential \
libssl-dev \
pkg-config \
curl \
wget \
git
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.81

- uses: Swatinem/rust-cache@v2 # use a different cache key as coverae uses custom rustc args
with:
cache-provider: buildjet
key: "coverage"

key: coverage
- uses: rui314/setup-mold@v1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.2"

scarb-version: 2.8.2
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest keeping line breaks between YAML sections as it follows standard formatting practices and improves readability.

- name: Build and run tests
env:
ETH_FORK_URL: ${{ secrets.ETH_FORK_URL }}
Expand All @@ -50,12 +56,10 @@ jobs:
export COVERAGE_BIN=$(realpath target/debug/madara)
rm -f target/madara-* lcov.info
cargo test --profile dev --workspace -- --test-threads=1

- name: Generate coverage info
run: |
source <(cargo llvm-cov show-env --export-prefix)
cargo llvm-cov report --lcov --output-path lcov.info

- name: Coveralls
uses: coverallsapp/github-action@v2
with:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/cron-daily.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
---
name: Workflow - Daily Cron

on:
"on":
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

- cron: 0 0 * * *
jobs:
stale_issues:
name: Stale issues
uses: ./.github/workflows/stale-issues.yml

security_audit:
name: Security audit
uses: ./.github/workflows/security-audit.yml
11 changes: 2 additions & 9 deletions .github/workflows/db-version.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
---
name: DB Version Management

on:
"on":
workflow_dispatch:
workflow_call:

jobs:
update-db-version:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'bump_db')
steps:
- uses: actions/checkout@v3

- name: Install yq
run: sudo apt-get install -y yq

- name: Check if PR already bumped
id: check_bump
run: |
Expand All @@ -24,21 +20,18 @@ jobs:
else
echo "already_bumped=false" >> $GITHUB_OUTPUT
fi

- name: Configure Git
if: steps.check_bump.outputs.already_bumped == 'false'
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

- name: Update DB Version
if: steps.check_bump.outputs.already_bumped == 'false'
run: |
./scripts/update-db-version.sh "${{ github.event.pull_request.number }}"

- name: Commit and Push
if: steps.check_bump.outputs.already_bumped == 'false'
run: |
run: |-
if [[ -n "$(git status --porcelain)" ]]; then
git add .db-versions.toml
git commit -m "chore: bump db version"
Expand Down
Loading
Loading