Skip to content

Commit

Permalink
Project is born 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
ubiratansoares committed Mar 19, 2024
1 parent 2142b3f commit 33b9b43
Show file tree
Hide file tree
Showing 21 changed files with 1,136 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://editorconfig.org
# Adapted from https://github.com/rust-lang/rust-clippy/blob/master/.editorconfig

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120

[*.md]
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false

[{*.yml,yaml}]
indent_size = 2
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto eol=lf
*.rs text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=4
*.fixed linguist-language=Rust
45 changes: 45 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"docker:pinDigests",
"helpers:pinGitHubActionDigests",
":pinDevDependencies"
],
"osvVulnerabilityAlerts": true,
"dependencyDashboard": true,
"labels": [
"dependencies"
],
"packageRules": [
{
"description": [
"Rust"
],
"matchPackageNames": [
"rust"
],
"matchManagers": [
"custom.regex"
],
"commitMessageTopic": "rust"
}
],
"customManagers": [
{
"description": [
"Update Rust stable version in rust-toolchain.toml"
],
"customType": "regex",
"fileMatch": [
"(^|/)rust-toolchain\\.toml$"
],
"matchStrings": [
"channel\\s*=\\s*\"(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)\""
],
"depNameTemplate": "rust",
"packageNameTemplate": "rust-lang/rust",
"datasourceTemplate": "github-releases"
}
]
}
45 changes: 45 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2024 Dotanuki Labs
# SPDX-License-Identifier: MIT

name: CD

on:
workflow_dispatch

jobs:
release:
runs-on: ubuntu-22.04

steps:
- name: Project Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install additional tools
run: |
sudo snap install --edge --classic just
sudo snap install zig --classic --beta && zig version
- name: Setup Rust and Cargo plugins
run: just setup-ci

- name: Check supply-chain issues
run: just supply-chain-checks

- name: Build against all supported targets
run: just cross-build

- name: Prepare to release
id: prepare-release
run: ./scripts/prepare-release.sh

- name: Create draft release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
with:
name: ${{ steps.prepare-release.outputs.version }}
tag_name: ${{ steps.prepare-release.outputs.version }}
token: ${{ secrets.DOTANUKI_BOT_TOKEN }}
generate_release_notes: true
draft: true
files: |
target/ci/**/*
gwv.cdx.json
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright 2024 Dotanuki Labs
# SPDX-License-Identifier: MIT

name: CI

on:
pull_request:
push:
branches:
- main

jobs:
essential-checks:
runs-on: ubuntu-22.04
steps:
- name: Project Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Run essential checks
uses: dotanuki-labs/github-actions/essentials@main
with:
file-patterns: '*.sh,*.rs,*.yml'
license: 'mit'
build:
runs-on: ubuntu-22.04
needs: essential-checks

steps:
- name: Project Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup CI caching
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Install additional tools
run: |
sudo snap install --edge --classic just
sudo snap install zig --classic --beta && zig version
- name: Setup Rust and Cargo plugins
run: just setup-ci

- name: Check code smells
run: just lint

- name: Run tests
run: just tests

- name: Check supply-chain issues
run: just supply-chain-checks

- name: Build against all supported targets
run: just cross-build

- name: Archive SBOM
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: sbom-${{ github.sha }}.json
path: gwv.cdx.json

- name: Archive binaries
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: gwv-binaries
path: target/ci
18 changes: 6 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# Rust builds
/target
gwv.cdx.json

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# IDE environment
.DS_STORE
.idea

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
19 changes: 19 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Dotanuki Labs
# SPDX-License-Identifier: MIT

pull_request_rules:
- name: Automatic merges for Renovate pull requests
conditions:
- author~=^renovate\[bot\]$
- check-success=build
actions:
merge:
method: squash

- name: Be author's friend
conditions:
- author~=^ubiratansoares
- check-success=build
actions:
merge:
method: squash
Loading

0 comments on commit 33b9b43

Please sign in to comment.