Skip to content

Commit

Permalink
Merge pull request #38 from sebastienrousseau/feat/libmake
Browse files Browse the repository at this point in the history
v0.2.6
  • Loading branch information
sebastienrousseau authored May 15, 2024
2 parents e6642c6 + 6463816 commit 3f00318
Show file tree
Hide file tree
Showing 90 changed files with 2,243 additions and 443 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: 🧪 Audit
on:
push:
branches:
- main
- feat/libmake
pull_request:
branches:
Expand All @@ -18,6 +19,10 @@ jobs:
- uses: hecrj/setup-rust-action@v2
- name: Install cargo-audit
run: cargo install cargo-audit

- uses: actions/checkout@v4
- name: Audit dependencies
- name: Resolve dependencies
run: cargo update

- name: Audit vulnerabilities
run: cargo audit
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: 🧪 Check
on:
push:
branches:
- main
- feat/libmake
pull_request:
branches:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 📶 Coverage

on:
push:
branches:
- main
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4

# Setup Rust nightly
- name: Install Rust
uses: actions-rs/toolchain@v1
id: toolchain
with:
toolchain: nightly
override: true

# Configure cache for Cargo
- name: Cache Cargo registry, index
uses: actions/cache@v4
id: cache-cargo
with:
path: |
~/.cargo/registry
~/.cargo/bin
~/.cargo/git
key: linux-${{ steps.toolchain.outputs.rustc_hash }}-rust-cov-${{ hashFiles('**/Cargo.lock') }}

# Run tests with all features
- name: Test (cargo test)
uses: actions-rs/cargo@v1
with:
command: test
args: "--workspace"

# Install grcov
- uses: actions-rs/[email protected]
id: coverage

# Upload to Codecov.io
- name: Upload to Codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}
20 changes: 9 additions & 11 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ on:
push:
branches:
- main
- feat/libmake
pull_request:
branches:
- feat/libmake
- main
release:
types: [created]

Expand Down Expand Up @@ -38,24 +37,23 @@ jobs:
echo '<html><head><meta http-equiv="refresh" content="0; url=/libmake/"></head><body></body></html>' > ./target/doc/index.html
- name: Deploy
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: documentation
path: target/doc
if-no-files-found: error
retention-days: 1

- name: Write CNAME file
run: echo 'docs.libmake.com' > ./target/doc/CNAME
run: echo 'doc.libmake.com' > ./target/doc/CNAME

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
publish_branch: gh-pages
cname: true
clean: true
commit_message: Deploy documentation at ${{ github.sha }}
commit_user_name: github-actions
commit_user_email: [email protected]
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
user_email: [email protected]
user_name: github-actions
50 changes: 43 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,59 @@
name: 🧪 Lint
name: 🧪 Document

on:
push:
branches:
- feat/libmake
- main
pull_request:
branches:
- feat/libmake
- main
release:
types: [created]

jobs:
all:
name: Lint
name: Document
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: hecrj/setup-rust-action@v2
with:
components: clippy
rust-version: nightly

- uses: actions/checkout@v4
- name: Check lints
run: cargo clippy --workspace --all-features --all-targets --no-deps -- -D warnings

- name: Update libssl
run: |
sudo apt-get update
sudo apt-get install -y libssl1.1
- name: Generate documentation for all features and publish it
run: |
RUSTDOCFLAGS="--cfg docsrs" \
cargo doc --no-deps --all-features --workspace
# Write index.html with redirect
echo '<html><head><meta http-equiv="refresh" content="0; url=/libmake/"></head><body></body></html>' > ./target/doc/index.html
- name: Deploy
uses: actions/upload-artifact@v4
with:
name: documentation
path: target/doc
if-no-files-found: error
retention-days: 1

- name: Write CNAME file
run: echo 'doc.libmakelib.com' > ./target/doc/CNAME

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
cname: true
commit_message: Deploy documentation at ${{ github.sha }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
user_email: [email protected]
user_name: github-actions
132 changes: 21 additions & 111 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: 🧪 Release

on: [push, pull_request]
on:
push:
branches:
- main
- feat/libmake
pull_request:
branches:
- feat/libmake
release:
types: [created]

concurrency:
group: ${{ github.ref }}
Expand All @@ -21,114 +30,25 @@ jobs:
BUILD_ID: ${{ github.run_id }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OS: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
OS: ${{ matrix.platform.os }}
TARGET: ${{ matrix.platform.target }}

strategy:
fail-fast: false
matrix:
target:
# List of targets:
# https://doc.rust-lang.org/nightly/rustc/platform-support.html

# Tier 1 platforms 🏆
- aarch64-unknown-linux-gnu # 64-bit Linux systems on ARM architecture
- i686-pc-windows-gnu # 32-bit Windows (i686-pc-windows-gnu)
- i686-pc-windows-msvc # 32-bit Windows (i686-pc-windows-msvc)
- i686-unknown-linux-gnu # 32-bit Linux (kernel 3.2+, glibc 2.17+)
- x86_64-apple-darwin # 64-bit macOS (10.7 Lion or later)
- x86_64-pc-windows-gnu # 64-bit Windows (x86_64-pc-windows-gnu)
- x86_64-pc-windows-msvc # 64-bit Windows (x86_64-pc-windows-msvc)
- x86_64-unknown-linux-gnu # 64-bit Linux (kernel 2.6.32+, glibc 2.11+)

# Tier 2 platforms 🥈
- aarch64-apple-darwin # 64-bit macOS on Apple Silicon
- aarch64-pc-windows-msvc # 64-bit Windows (aarch64-pc-windows-msvc)
- aarch64-unknown-linux-musl # 64-bit Linux systems on ARM architecture
- arm-unknown-linux-gnueabi # ARMv6 Linux (kernel 3.2, glibc 2.17)
- arm-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
- armv7-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
- powerpc-unknown-linux-gnu # PowerPC Linux (kernel 3.2, glibc 2.17)
- powerpc64-unknown-linux-gnu # PowerPC64 Linux (kernel 3.2, glibc 2.17)
- powerpc64le-unknown-linux-gnu # PowerPC64le Linux (kernel 3.2, glibc 2.17)
# - riscv64gc-unknown-linux-gnu # RISC-V Linux (kernel 3.2, glibc 2.17)
- s390x-unknown-linux-gnu # s390x Linux (kernel 3.2, glibc 2.17)
- x86_64-unknown-freebsd # 64-bit FreeBSD on x86-64
- x86_64-unknown-linux-musl # 64-bit Linux (kernel 2.6.32+, musl libc)
# - x86_64-unknown-netbsd # 64-bit NetBSD on x86-64

include:
# Tier 1 platforms 🏆
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: i686-pc-windows-gnu
os: ubuntu-latest
cross: true
- target: i686-pc-windows-msvc
platform:
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
cross: true
- target: i686-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: x86_64-apple-darwin
os: macos-latest
cross: true
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
cross: true
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: true
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
cross: true

# Tier 2 platforms 🥈
- target: aarch64-apple-darwin
os: macos-latest
cross: true
- target: aarch64-pc-windows-msvc
os: windows-latest
cross: true
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
cross: true
- target: arm-unknown-linux-gnueabi
os: ubuntu-latest
cross: true
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
cross: true
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
cross: true
- target: powerpc-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: powerpc64-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
cross: true
# - target: riscv64gc-unknown-linux-gnu
# os: ubuntu-latest
# cross: true
- target: s390x-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: x86_64-unknown-freebsd
os: ubuntu-latest
cross: true
- target: x86_64-unknown-linux-musl
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
cross: true
# - target: x86_64-unknown-netbsd
# os: ubuntu-latest
# cross: true

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.platform.os }}

steps:
# Check out the repository code.
Expand All @@ -147,7 +67,7 @@ jobs:
# Cache dependencies to speed up subsequent builds.
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -158,21 +78,11 @@ jobs:
id: install-target
run: rustup target add ${{ env.TARGET }}

- name: Install Cross and clean artifacts
run: |
# Install cross
cargo install cross
# Clean the build artifacts
cargo clean --verbose
shell: bash

# Build the targets
- name: Build targets
id: build-targets
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --verbose --workspace --release --target ${{ env.TARGET }}

Expand Down Expand Up @@ -219,7 +129,7 @@ jobs:

# Cache dependencies to speed up subsequent builds
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
Expand Down Expand Up @@ -310,7 +220,7 @@ jobs:
# Cache dependencies to speed up subsequent builds
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /home/runner/.cargo/registry/index/
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
Expand Down
Loading

0 comments on commit 3f00318

Please sign in to comment.