Skip to content

Commit

Permalink
Merge pull request #197 from tauri-apps/ci-setup
Browse files Browse the repository at this point in the history
Improved CI setup
  • Loading branch information
JonasKruckenberg authored Sep 14, 2023
2 parents 4fc443e + 7664df8 commit 99e0a28
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
RUSTFLAGS: ${{matrix.rustflags}} ${{env.RUSTFLAGS}}

msrv:
name: Rust 1.70.0
name: Rust MSRV
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
Expand All @@ -55,7 +55,9 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libgtk-3-dev
- uses: dtolnay/[email protected]
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.70.0 # MSRV
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --tests

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Spelling

permissions:
contents: read

on: [pull_request]

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CLICOLOR: 1

jobs:
spelling:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Spell Check Repo
uses: crate-ci/typos@master
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "tauri-bindgen"
authors.workspace = true
version.workspace = true
edition.workspace = true
rust-version.workspace = true
rust-version.workspace = true # MSRV

[workspace]
members = ["crates/*"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Here are a few reasons why that is cool:

- **Compile-time Checks**

When using strongly typed languages, such as Rust, TypeScript or ReScript the generated code will automatically ensure that you are calling the API correctly, as long as it passes the type checking youre golden. This is especially neat **when working in a team**, so your colleagues can't just change command signatures and pull the rug out from under you.
When using strongly typed languages, such as Rust, TypeScript or ReScript the generated code will automatically ensure that you are calling the API correctly, as long as it passes the type checking your golden. This is especially neat **when working in a team**, so your colleagues can't just change command signatures and pull the rug out from under you.

- **Easily auditable**

Expand Down
2 changes: 1 addition & 1 deletion crates/wit-parser/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub enum Error {
#[label("cannot be defined twice")]
location: Span,
},
/// Types can't recursively refer to themselves as that would make then possibly infinitly-sized.
/// Types can't recursively refer to themselves as that would make then possibly infinitely-sized.
/// In Rust the compiler would force you to use heap indirection, however such a thing doesn't exist in out type system.
///
/// This wouldn't be a problem with the current JSON format, but a custom binary one would have this limitation so for future proofing we deny recursive types.
Expand Down
2 changes: 1 addition & 1 deletion docs/WIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func greet(name: string) -> string
At the top-level of each `wit` document lives the `interface` definition, file must contain exactly one such definition.
The name you give to an interface will dictate the name of the generated module and printed debug output.

An interface may contain function declarations and type defintions. The order of declaration doesn't matter so you are free to define types after you have used them for example.
An interface may contain function declarations and type definitions. The order of declaration doesn't matter so you are free to define types after you have used them for example.

```wit
interface empty {}
Expand Down
6 changes: 0 additions & 6 deletions renovate.json

This file was deleted.

103 changes: 103 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
// schedule: [
// 'before 5am on the first day of the month',
//],
semanticCommits: 'enabled',
configMigration: true,
dependencyDashboard: true,
regexManagers: [
{
customType: 'regex',
fileMatch: [
'^rust-toolchain\\.toml$',
'Cargo.toml$',
'clippy.toml$',
'\\.clippy.toml$',
'^\\.github/workflows/ci.yml$',
'^\\.github/workflows/rust-next.yml$',
],
matchStrings: [
'MSRV.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?MSRV',
],
depNameTemplate: 'rust',
packageNameTemplate: 'rust-lang/rust',
datasourceTemplate: 'github-releases',
},
],
packageRules: [
{
commitMessageTopic: 'MSRV',
matchManagers: [
'regex',
],
matchPackageNames: [
'rust',
],
minimumReleaseAge: '252 days', // 6 releases * 6 weeks per release * 7 days per week
internalChecksFilter: 'strict',
},
// Goals:
// - Keep version reqs low, ignoring compatible normal/build dependencies
// - Take advantage of latest dev-dependencies
// - Rollup safe upgrades to reduce CI runner load
// - Help keep number of versions down by always using latest breaking change
// - Have lockfile and manifest in-sync
{
matchManagers: [
'cargo',
],
matchDepTypes: [
'build-dependencies',
'dependencies',
],
matchCurrentVersion: '>=0.1.0',
matchUpdateTypes: [
'patch',
],
enabled: false,
},
{
matchManagers: [
'cargo',
],
matchDepTypes: [
'build-dependencies',
'dependencies',
],
matchCurrentVersion: '>=1.0.0',
matchUpdateTypes: [
'minor',
],
enabled: false,
},
{
matchManagers: [
'cargo',
],
matchDepTypes: [
'dev-dependencies',
],
matchCurrentVersion: '>=0.1.0',
matchUpdateTypes: [
'patch',
],
automerge: true,
groupName: 'compatible (dev)',
},
{
matchManagers: [
'cargo',
],
matchDepTypes: [
'dev-dependencies',
],
matchCurrentVersion: '>=1.0.0',
matchUpdateTypes: [
'minor',
],
automerge: true,
groupName: 'compatible (dev)',
},
],
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct Cli {

#[derive(Debug, Parser)]
enum Command {
/// Check a defintion file for errors.
/// Check a definition file for errors.
Check {
#[clap(flatten)]
world: WorldOpt,
Expand Down
4 changes: 4 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[default.extend-words]
# Abbreviations
inout = "inout"
ser = "ser"

0 comments on commit 99e0a28

Please sign in to comment.