mirror of
https://github.com/deps-rs/deps.rs.git
synced 2024-11-22 02:16:30 +00:00
Initial GitHub Actions CI configuration (#49)
This commit is contained in:
parent
12bb5c609d
commit
fd3fbbc2f6
3 changed files with 60 additions and 6 deletions
58
.github/workflows/premerge.yml
vendored
Normal file
58
.github/workflows/premerge.yml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
name: Premerge
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: 0 0 1 * *
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly-2020-09-27
|
||||
override: true
|
||||
|
||||
- name: Build check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
|
||||
- name: Tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
|
||||
linting:
|
||||
if: ${{ github.ref != 'main' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly-2020-09-27
|
||||
default: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: format
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
- name: clippy
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: -- -D warnings
|
|
@ -1,3 +0,0 @@
|
|||
language: rust
|
||||
rust: nightly
|
||||
cache: cargo
|
|
@ -4,8 +4,7 @@ use base64::display::Base64Display;
|
|||
use once_cell::sync::Lazy;
|
||||
use rusttype::{point, Font, Point, PositionedGlyph, Scale};
|
||||
|
||||
const FONT_DATA: &'static [u8] =
|
||||
include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/DejaVuSans.ttf"));
|
||||
const FONT_DATA: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/DejaVuSans.ttf"));
|
||||
const FONT_SIZE: f32 = 11.;
|
||||
const SCALE: Scale = Scale {
|
||||
x: FONT_SIZE,
|
||||
|
@ -45,7 +44,7 @@ static DATA: Lazy<BadgeStaticData> = Lazy::new(|| {
|
|||
|
||||
BadgeStaticData {
|
||||
font,
|
||||
scale: SCALE.clone(),
|
||||
scale: SCALE,
|
||||
offset,
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue