diff --git a/.github/workflows/audit-nightly.yml b/.github/workflows/audit-nightly.yml new file mode 100644 index 0000000..cb03fc1 --- /dev/null +++ b/.github/workflows/audit-nightly.yml @@ -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 diff --git a/.github/workflows/audit-on-push.yml b/.github/workflows/audit-on-push.yml new file mode 100644 index 0000000..d5fc18b --- /dev/null +++ b/.github/workflows/audit-on-push.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..78266a5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,110 @@ +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: + - 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: Build binary + uses: houseabsolute/actions-rust-cross@v0 + with: + command: "build" + target: ${{ matrix.platform.target }} + toolchain: ${{ matrix.toolchain }} + args: "--locked --release" + strip: true + - name: Run tests + uses: houseabsolute/actions-rust-cross@v0 + with: + command: "test" + target: ${{ matrix.platform.target }} + toolchain: ${{ matrix.toolchain }} + args: "--locked --release" + if: ${{ !matrix.platform.skip_tests }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b116de6 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 "jdoe@example.com" + 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