Skip to content

Commit

Permalink
Add GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Aug 26, 2023
1 parent ba6f428 commit 37cd443
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/audit-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security audit - nightly

on:
schedule:
- cron: "0 0 * * *"

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/audit@v1
16 changes: 16 additions & 0 deletions .github/workflows/audit-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Security audit - on push

on:
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
tags-ignore:
- "precious-*"

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/audit@v1
106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Continuous integration

on:
push:
branches:
- "**"
tags-ignore:
- "dioxus-heroicons-*"
pull_request:

env:
CRATE_NAME: dioxus-heroicons
RUST_BACKTRACE: 1

jobs:
test:
name: Test - ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
# Commented-out platforms failed tests with issues compiling
# serde_derive - "/lib/x86_64-linux-gnu/libc.so.6: version
# `GLIBC_2.25' not found (required by
# /target/release/deps/libserde_derive-f1b53d0dcbb4543f.so)"
- os_name: FreeBSD-x86_64
os: ubuntu-20.04
target: x86_64-unknown-freebsd
skip_tests: true
- os_name: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
- os_name: Linux-aarch64
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
- os_name: Linux-arm
os: ubuntu-20.04
target: arm-unknown-linux-musleabi
- os_name: Linux-i686
os: ubuntu-20.04
target: i686-unknown-linux-musl
- os_name: Linux-mips
os: ubuntu-20.04
target: mips-unknown-linux-musl
- os_name: Linux-mipsel
os: ubuntu-20.04
target: mipsel-unknown-linux-musl
- os_name: Linux-mips64
os: ubuntu-20.04
target: mips64-unknown-linux-muslabi64
- os_name: Linux-mips64el
os: ubuntu-20.04
target: mips64el-unknown-linux-muslabi64
# - os_name: Linux-powerpc
# os: ubuntu-20.04
# target: powerpc-unknown-linux-gnu
- os_name: Linux-powerpc64
os: ubuntu-20.04
target: powerpc64-unknown-linux-gnu
# - os_name: Linux-powerpc64le
# os: ubuntu-20.04
# target: powerpc64le-unknown-linux-gnu
- os_name: Linux-riscv64
os: ubuntu-20.04
target: riscv64gc-unknown-linux-gnu
# - os_name: Linux-s390x
# os: ubuntu-20.04
# target: s390x-unknown-linux-gnu
- os_name: NetBSD-x86_64
os: ubuntu-20.04
target: x86_64-unknown-netbsd
skip_tests: true
- os_name: Windows-aarch64
os: windows-latest
target: aarch64-pc-windows-msvc
skip_tests: true
- os_name: Windows-i686
os: windows-latest
target: i686-pc-windows-msvc
- os_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
skip_tests: true
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- name: Run tests
uses: houseabsolute/actions-rust-cross@v0
with:
command: "test"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--workspace --release"
if: ${{ !matrix.platform.skip_tests }}
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint

on: [push, pull_request]

env:
CRATE_NAME: precious
GITHUB_TOKEN: ${{ github.token }}
RUST_BACKTRACE: 1

jobs:
lint:
name: Check that code is lint clean using precious
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "J. Doe"
- name: Run install-dev-tools.sh
run: |
set -e
mkdir $HOME/bin
./dev/bin/install-dev-tools.sh
- name: Run precious
run: |
PATH=$PATH:$HOME/bin precious lint -a

0 comments on commit 37cd443

Please sign in to comment.