Skip to content

Commit

Permalink
migrate from TravisCI to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Jul 8, 2024
1 parent bd3e45f commit b94b579
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 182 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI-PR

on:
pull_request:
# branches: [master, main]

concurrency:
group: ci-pr-${{ github.ref }}
cancel-in-progress: true

jobs:
ci-pr:
name: CI-PR
needs: [test-full, test-minimal, lint]
runs-on: ubuntu-latest
steps:
- name: Done
run: exit 0
test-full:
name: Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable]
runs-on: ${{ matrix.os }}
steps:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache Builds
uses: Swatinem/rust-cache@v2
- name: Checkout
uses: actions/checkout@v4
- name: Compile
run: cargo test --no-run --all-features
- name: Test
run: cargo test --all-features
test-minimal:
name: Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable]
runs-on: ${{ matrix.os }}
steps:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache Builds
uses: Swatinem/rust-cache@v2
- name: Checkout
uses: actions/checkout@v4
- name: Compile
run: cargo test --no-run --no-default-features
- name: Test
run: cargo test --no-default-features
lint:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Check spelling
uses: crate-ci/typos@master

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Clippy
run: cargo clippy --all-features --all-targets

- name: Format Check
run: cargo fmt --check


85 changes: 85 additions & 0 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
on:
push:
branches: [master, main]

name: Nightly Release

env:
RELEASE_BIN: clog
RELEASE_ADDS: >-
LICENSE-APACHE
LICENSE-MIT
nightly-CHANGELOG.md
README.md
jobs:
nightly-release:
name: Nightly Release

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: x86_64-unknown-linux-musl

- name: Install cc
run: sudo apt-get update && sudo apt-get install --yes gcc

- name: Compile
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target x86_64-unknown-linux-musl

- name: Install CLOG
uses: actions-rs/cargo@v1
with:
command: install
args: clog-cli

- name: Generate Changelog
run: clog -F -o nightly-CHANGELOG.md -i /dev/null

- name: Make artifacts dir
run: mkdir -p artifacts/

- name: Copy all artifacts into dir
run: cp target/x86_64-unknown-linux-musl/release/${{ env.RELEASE_BIN }} ${{ env.RELEASE_ADDS }} artifacts/

- uses: benjlevesque/[email protected]
id: short-sha

- name: Create archive for Linux
run: cd artifacts/ && tar czf ../${{ env.RELEASE_BIN }}-${{ env.SHA }}-x86_64-linux-musl.tar.gz ./*
env:
SHA: ${{ steps.short-sha.outputs.sha }}

- name: Remove previous Nightly Release
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: nightly
repo: clog-tool/clog-cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Nightly Release
uses: softprops/action-gh-release@v1
with:
name: clog Nightly (${{ env.SHA }})
tag_name: nightly
prerelease: true
body_path: nightly-CHANGELOG.md
files: |
${{ env.RELEASE_BIN }}-${{ env.SHA }}-x86_64-linux-musl.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: clog-tool/clog-cli
SHA: ${{ steps.short-sha.outputs.sha }}

18 changes: 18 additions & 0 deletions .github/workflows/security_audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'

name: Security audit

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

122 changes: 0 additions & 122 deletions .travis.yml

This file was deleted.

60 changes: 0 additions & 60 deletions ci/install.sh

This file was deleted.

0 comments on commit b94b579

Please sign in to comment.