Skip to content

Commit

Permalink
Refactoring and updates (#19)
Browse files Browse the repository at this point in the history
* Switched to nightly rust

* Fixed comments

* Upgraded dependencies
  • Loading branch information
konstantinzolotarev authored Jan 16, 2025
1 parent 0b2ca38 commit 781cbbd
Show file tree
Hide file tree
Showing 17 changed files with 2,619 additions and 2,695 deletions.
35 changes: 14 additions & 21 deletions .github/workflows/release.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,27 @@ name: release-docker
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
workflow_dispatch: {}

jobs:
docker-image-alpine:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow
permissions:
id-token: write
packages: write
contents: read
id-token: write
packages: write
contents: read
timeout-minutes: 120
steps:
-
name: Checkout repository
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Docker meta alpine
- name: Docker meta alpine
id: meta_alpine
uses: docker/metadata-action@v4
with:
Expand All @@ -38,23 +35,19 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to ghcr.io
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Prepare Docker envs
- name: Prepare Docker envs
shell: bash
run: |
echo "VERSION=${GITHUB_REF##*/v}" >> $GITHUB_ENV
-
name: Build and push (alpine)
- name: Build and push (alpine)
uses: docker/build-push-action@v4
with:
push: true
Expand All @@ -63,4 +56,4 @@ jobs:
file: ./Dockerfile
tags: ${{ steps.meta_alpine.outputs.tags }}
build-args: |
VERSION=${{ env.VERSION }}
VERSION=${{ env.VERSION }}
52 changes: 26 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
create-release:
name: create-release
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
sws_version: ${{ env.SWS_VERSION }}
Expand Down Expand Up @@ -66,64 +66,64 @@ jobs:
# - windows-msvc-arm64
include:
- build: linux-musl
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-musl
- build: linux-musl-i686
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: i686-unknown-linux-musl
- build: linux-musl-arm64
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: aarch64-unknown-linux-musl
- build: linux-gnu
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: linux-gnu-i686
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: i686-unknown-linux-gnu
- build: linux-gnu-arm64
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: aarch64-unknown-linux-gnu
- build: linux-arm-gnueabihf
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: arm-unknown-linux-gnueabihf
- build: linux-musl-armv6
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: arm-unknown-linux-musleabihf
- build: linux-musl-armv7
os: ubuntu-22.04
rust: stable
os: ubuntu-latest
rust: nightly
target: armv7-unknown-linux-musleabihf
- build: macos
os: macos-12
rust: stable
rust: nightly
target: x86_64-apple-darwin
- build: macos-arm64
os: macos-12
rust: stable
rust: nightly
target: aarch64-apple-darwin
# - build: windows-msvc
# os: windows-2022
# rust: stable
# rust: nightly
# target: x86_64-pc-windows-msvc
# - build: windows-msvc-i686
# os: windows-2022
# rust: stable
# rust: nightly
# target: i686-pc-windows-msvc
# - build: windows-pc-gnu
# os: windows-2022
# rust: stable-x86_64-gnu
# rust: nightly-x86_64-gnu
# target: x86_64-pc-windows-gnu
# - build: windows-msvc-arm64
# os: windows-2022
# rust: stable
# rust: nightly
# target: aarch64-pc-windows-msvc

steps:
Expand All @@ -141,7 +141,7 @@ jobs:
- name: Set up Cross
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
cargo install cross@^0.2
echo "CARGO_BIN=cross" >> $GITHUB_ENV
fi
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,27 @@ env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt --all --check

test:
name: tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
Expand All @@ -38,24 +52,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo clippy --workspace --all-targets --all-features
env:
RUSTFLAGS: -Dwarnings

fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check

typos-check:
name: TyposCheck
timeout-minutes: 5
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.DS_Store
.vscode
.idea
.zed
LOCAL.md
4 changes: 4 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
indent_style = "Block"
tab_spaces = 2
imports_granularity = "Crate"
edition = "2021"
Loading

0 comments on commit 781cbbd

Please sign in to comment.