Add GitHub Actions configuration

This commit is contained in:
Dirkjan Ochtman 2023-02-23 13:38:36 +01:00
parent 3829ed77fa
commit 5019fc39ea
4 changed files with 85 additions and 119 deletions

View File

@ -1,119 +0,0 @@
---
kind: pipeline
name: epp-client
platform:
os: linux
arch: amd64
steps:
- name: check
image: rust:1.59
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo check --all-targets
- name: fmt
image: rust:1.59
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- rustup component add rustfmt
- cargo fmt --all -- --check
- name: clippy
image: rust:1.59
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- rustup component add clippy
- cargo clippy --workspace --all-targets -- -D warnings
- name: test
image: rust:1.59
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo test -- --nocapture
- name: crates.io
image: rust:1.59
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
environment:
CARGO_TOKEN:
from_secret: cargo_token
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo publish --token $CARGO_TOKEN
when:
branch:
- 0.2
- 0.3
- 0.4
event: push
- name: notify
image: drillster/drone-email
environment:
PLUGIN_HOST:
from_secret: mail_host
PLUGIN_FROM:
from_secret: mail_sender
PLUGIN_FROM_NAME:
from_secret: mail_sender_name
PLUGIN_PORT:
from_secret: mail_port
PLUGIN_USERNAME:
from_secret: mail_user
PLUGIN_PASSWORD:
from_secret: mail_password
PLUGIN_RECIPIENTS:
from_secret: mail_recipients
when:
status:
- failure
volumes:
- name: target
host:
path: /var/drone/cache/epp-client-target
- name: cache
host:
path: /var/drone/cache/epp-client-cache
...

8
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
time: "13:00"
open-pull-requests-limit: 99

62
.github/workflows/rust.yml vendored Normal file
View File

@ -0,0 +1,62 @@
name: CI
on:
push:
branches: ['main']
pull_request:
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, beta]
exclude:
- os: macos-latest
rust: beta
- os: windows-latest
rust: beta
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --all-features --all-targets
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
if: always()
with:
command: clippy
args: --workspace --all-targets --all-features -- -D warnings
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1

15
deny.toml Normal file
View File

@ -0,0 +1,15 @@
[licenses]
allow-osi-fsf-free = "either"
copyleft = "deny"
allow = ["MPL-2.0"]
[advisories]
ignore = ["RUSTSEC-2020-0071"]
unsound = "deny"
unmaintained = "deny"
yanked = "deny"
[[licenses.clarify]]
name = "ring"
expression = "ISC AND MIT AND OpenSSL"
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]