-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate from TravisCI to Github Actions
- Loading branch information
Showing
5 changed files
with
190 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.