Skip to content

Commit b935f21

Browse files
committed
chore: migrate from TravisCI to Github Actions
1 parent 99119b9 commit b935f21

File tree

5 files changed

+185
-182
lines changed

5 files changed

+185
-182
lines changed

.github/workflows/ci-pr.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI-PR
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ci-pr-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
ci-pr:
12+
name: CI-PR
13+
needs: [test-full, test-minimal, lint]
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Done
17+
run: exit 0
18+
test-full:
19+
name: Tests
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, windows-latest, macOS-latest]
24+
rust: [stable]
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- name: Install rust
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
profile: minimal
31+
toolchain: ${{ matrix.rust }}
32+
override: true
33+
- name: Cache Builds
34+
uses: Swatinem/rust-cache@v2
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
- name: Compile
38+
run: cargo test --no-run --all-features
39+
- name: Test
40+
run: cargo test --all-features
41+
test-minimal:
42+
name: Tests
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
os: [ubuntu-latest, windows-latest, macOS-latest]
47+
rust: [stable]
48+
runs-on: ${{ matrix.os }}
49+
steps:
50+
- name: Install rust
51+
uses: actions-rs/toolchain@v1
52+
with:
53+
profile: minimal
54+
toolchain: ${{ matrix.rust }}
55+
override: true
56+
- name: Cache Builds
57+
uses: Swatinem/rust-cache@v2
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
- name: Compile
61+
run: cargo test --no-run --no-default-features
62+
- name: Test
63+
run: cargo test --no-default-features
64+
lint:
65+
runs-on: ${{ matrix.os }}
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Check spelling
70+
uses: crate-ci/typos@master
71+
72+
- name: Install Rust
73+
uses: dtolnay/rust-toolchain@stable
74+
with:
75+
toolchain: nightly
76+
components: rustfmt, clippy
77+
78+
- uses: Swatinem/rust-cache@v2
79+
80+
- name: Clippy
81+
run: cargo clippy --all-features --all-targets
82+
83+
- name: Format Check
84+
run: cargo fmt --check
85+
86+

.github/workflows/release_nightly.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
on:
3+
push:
4+
branches: [master, main]
5+
6+
name: Nightly Release
7+
8+
env:
9+
RELEASE_BIN: clog
10+
RELEASE_ADDS: >-
11+
LICENSE-APACHE
12+
LICENSE-MIT
13+
nightly-CHANGELOG.md
14+
README.md
15+
16+
jobs:
17+
nightly-release:
18+
name: Nightly Release
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: nightly
28+
override: true
29+
target: x86_64-unknown-linux-musl
30+
31+
- name: Compile
32+
uses: actions-rs/cargo@v1
33+
with:
34+
command: build
35+
args: --release --target x86_64-unknown-linux-musl
36+
37+
- name: Install CLOG
38+
uses: actions-rs/cargo@v1
39+
with:
40+
command: install
41+
args: clog-cli
42+
43+
- name: Generate Changelog
44+
run: clog -F -o nightly-CHANGELOG.md -i /dev/null
45+
46+
- name: Make artifacts dir
47+
run: mkdir -p artifacts/
48+
49+
- name: Copy all artifacts into dir
50+
run: cp target/x86_64-unknown-linux-musl/release/${{ env.RELEASE_BIN }} ${{ env.RELEASE_ADDS }} artifacts/
51+
52+
- uses: benjlevesque/[email protected]
53+
id: short-sha
54+
55+
- name: Create archive for Linux
56+
run: cd artifacts/ && tar czf ../${{ env.RELEASE_BIN }}-${{ env.SHA }}-x86_64-linux-musl.tar.gz ./*
57+
env:
58+
SHA: ${{ steps.short-sha.outputs.sha }}
59+
60+
- name: Remove previous Nightly Release
61+
uses: dev-drprasad/[email protected]
62+
with:
63+
delete_release: true
64+
tag_name: nightly
65+
repo: clog-tool/clog-cli
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Create Nightly Release
70+
uses: softprops/action-gh-release@v1
71+
with:
72+
name: clog Nightly (${{ env.SHA }})
73+
tag_name: nightly
74+
prerelease: true
75+
body_path: nightly-CHANGELOG.md
76+
files: |
77+
${{ env.RELEASE_BIN }}-${{ env.SHA }}-x86_64-linux-musl.tar.gz
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
GITHUB_REPOSITORY: clog-tool/clog-cli
81+
SHA: ${{ steps.short-sha.outputs.sha }}
82+

.github/workflows/security_audit.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
on:
3+
push:
4+
paths:
5+
- '**/Cargo.toml'
6+
- '**/Cargo.lock'
7+
8+
name: Security audit
9+
10+
jobs:
11+
security_audit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions-rs/audit-check@v1
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

-122
This file was deleted.

ci/install.sh

-60
This file was deleted.

0 commit comments

Comments
 (0)