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

[ci] Add more linters, prepare to onboard Renovate bot #1

Merged
merged 2 commits into from
Nov 28, 2024
Merged
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
19 changes: 19 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
self-hosted-runner:
# Labels of self-hosted runner in array of strings.
labels: []

# Configuration variables in array of strings defined in your repository or
# organization. `null` means disabling configuration variables check.
# Empty array means no configuration variable is allowed.
config-variables:

# Configuration for file paths. The keys are glob patterns to match to file
# paths relative to the repository root. The values are the configurations for
# the file paths. Note that the path separator is always '/'.
# The following configurations are available.
#
# "ignore" is an array of regular expression patterns. Matched error messages
# are ignored. This is similar to the "-ignore" command line option.
paths:
# .github/workflows/**/*.yml:
# ignore: []
24 changes: 12 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Lint

on:
pull_request:
push:
branches: [master]
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt,clippy
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt,clippy
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
129 changes: 65 additions & 64 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,80 +1,81 @@
name: Release

permissions:
contents: write
contents: write

on:
push:
tags: ['*']
push:
tags: ['*']

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
needs: create-release
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
upload-assets:
needs: create-release
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

# Some windows magic
# https://github.com/nymtech/nym-vpn-client/pull/54/files#diff-7a42dc8739297053550b8882b7bf3fcc770725f51365f7b273ed5a7d9d91c329R151
# https://github.com/sfackler/rust-openssl/issues/2149
- name: Enable git long-paths
if: contains(matrix.os, 'windows')
run: git config --system core.longpaths true
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
if: contains(matrix.os, 'windows')
with:
perl-version: '5.38'
distribution: strawberry
- id: windows-configure-perl
if: contains(matrix.os, 'windows')
run: |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Enable git long-paths
if: contains(matrix.os, 'windows')
run: git config --system core.longpaths true
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
if: contains(matrix.os, 'windows')
with:
perl-version: '5.38'
distribution: strawberry
- id: windows-configure-perl
if: contains(matrix.os, 'windows')
run: |
# shellcheck disable=SC1073,SC1009,SC1072
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8

- uses: taiki-e/upload-rust-binary-action@v1
with:
- uses: taiki-e/upload-rust-binary-action@v1
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: toggl-tracker
checksum: sha256
target: ${{ matrix.target }}
token: ${{ secrets.GITHUB_TOKEN }}
bin: toggl-tracker
checksum: sha256
target: ${{ matrix.target }}
token: ${{ secrets.GITHUB_TOKEN }}

complete-release:
needs: upload-assets
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v2
with:
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
complete-release:
needs: upload-assets
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v2
with:
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 28 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: trailing-whitespace
Expand All @@ -11,11 +11,31 @@ repos:
- id: check-symlinks
- id: mixed-line-ending
args: [--fix=lf]
- id: check-toml
- id: check-yaml
- repo: https://github.com/doublify/pre-commit-rust
- id: check-toml
- id: check-yaml

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
- id: clippy
- id: fmt
- id: cargo-check
- id: clippy

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '4']
- id: pretty-format-toml
args: [--autofix, --indent, '4', --trailing-comma]
exclude: ^Cargo.lock$

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows

- repo: https://github.com/rhysd/actionlint
rev: v1.7.4
hooks:
- id: actionlint
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[package]
name = "toggl-tracker"
version = "0.1.0"
edition = "2021"

[dependencies]
async-std = "1.13.0"
base64 = "0.22.1"
chrono = { version = "0.4.38", features = ["serde", "unstable-locales"] }
chrono = {version = "0.4.38", features = ["serde", "unstable-locales"]}
directories-next = "2.0.0"
env_logger = "0.11.5"
iced = { version = "0.13.1", features = ["async-std", "debug", "advanced", "image"] }
iced_aw = { version = "0.11.0", features = ["badge", "menu"], default-features = false }
iced = {version = "0.13.1", features = ["async-std", "debug", "advanced", "image"]}
iced_aw = {version = "0.11.0", features = ["badge", "menu"], default-features = false}
itertools = "0.13.0"
lazy_static = "1.5.0"
log = { version = "0.4.22", features = ["max_level_trace", "release_max_level_info"] }
openssl = { version = "0.10.66", features = ["vendored"] }
serde = { version = "1.0.210", features = ["derive"] }
log = {version = "0.4.22", features = ["max_level_trace", "release_max_level_info"]}
openssl = {version = "0.10.66", features = ["vendored"]}
serde = {version = "1.0.210", features = ["derive"]}
serde_json = "1.0.128"
surf = { version = "2.3.2" }
surf = {version = "2.3.2"}
sys-locale = "0.3.1"

[dev-dependencies]
async-std = { version = "1.13.0", features = ["attributes"] }
async-std = {version = "1.13.0", features = ["attributes"]}

[package]
edition = "2021"
name = "toggl-tracker"
version = "0.1.0"

[profile.release]
strip = true
lto = true
strip = true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Toggl Track client

[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)

## Disclaimer

This project is built solely by me with no affiliation with Toggl OÜ whatsoever.
Expand Down
Loading