Skip to content

Commit ba53bc0

Browse files
committed
example import
0 parents  commit ba53bc0

File tree

17 files changed

+598
-0
lines changed

17 files changed

+598
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
1. Go to '...'
17+
2. Click on '....'
18+
3. Scroll down to '....'
19+
4. See error
20+
21+
**Expected behavior**
22+
A clear and concise description of what you expected to happen.
23+
24+
**Screenshots**
25+
If applicable, add screenshots to help explain your problem.
26+
27+
**Desktop (please complete the following information):**
28+
29+
- OS: [e.g. iOS]
30+
- Browser [e.g. chrome, safari]
31+
- Version [e.g. 22]
32+
33+
**Additional context**
34+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Description
2+
3+
Please explain the changes you made here.
4+
5+
## Checklist
6+
7+
- [ ] I have read
8+
[CONTRIBUTING](https://github.com/rust-github/rust-gh-example/blob/master/docs/CONTRIBUTING.md)
9+
guidelines.
10+
- [ ] I have formatted the code using [rustfmt](https://github.com/rust-lang/rustfmt)
11+
- [ ] I have checked that all tests pass, by running `cargo test --all`
12+
13+
#### [CHANGELOG](https://github.com/rust-github/rust-gh-example/blob/master/CHANGELOG.md):
14+
15+
- [ ] Updated
16+
- [ ] I will update it after this PR has been discussed
17+
- [ ] No need to update

.github/workflows/audit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Security audit
2+
3+
on:
4+
schedule:
5+
# Runs at 00:00 UTC everyday
6+
- cron: '0 0 * * *'
7+
push:
8+
paths:
9+
- '**/Cargo.toml'
10+
- '**/Cargo.lock'
11+
pull_request:
12+
13+
jobs:
14+
audit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
- uses: actions-rs/audit-check@v1
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cd.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Continuous Deployment
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
publish:
10+
name: Publishing for ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [macos-latest, ubuntu-latest, windows-latest]
15+
rust: [stable]
16+
include:
17+
- os: macos-latest
18+
artifact_prefix: macos
19+
target: x86_64-apple-darwin
20+
binary_postfix: ""
21+
- os: ubuntu-latest
22+
artifact_prefix: linux
23+
target: x86_64-unknown-linux-gnu
24+
binary_postfix: ""
25+
- os: windows-latest
26+
artifact_prefix: windows
27+
target: x86_64-pc-windows-msvc
28+
binary_postfix: ".exe"
29+
30+
steps:
31+
- name: Installing Rust toolchain
32+
uses: actions-rs/toolchain@v1
33+
with:
34+
toolchain: ${{ matrix.rust }}
35+
override: true
36+
- name: Checkout repository
37+
uses: actions/checkout@v2
38+
- name: Cargo build
39+
uses: actions-rs/cargo@v1
40+
with:
41+
command: build
42+
toolchain: ${{ matrix.rust }}
43+
args: --release --target ${{ matrix.target }}
44+
45+
- name: Packaging final binary
46+
shell: bash
47+
run: |
48+
cd target/${{ matrix.target }}/release
49+
strip spt${{ matrix.binary_postfix }}
50+
tar czvf rust-gh-example-${{ matrix.artifact_prefix }}.tar.gz spt${{ matrix.binary_postfix }}
51+
52+
if [[ ${{ runner.os }} == 'Windows' ]]; then
53+
certutil -hashfile rust-gh-example-${{ matrix.artifact_prefix }}.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > rust-gh-example-${{ matrix.artifact_prefix }}.sha256
54+
else
55+
shasum -a 256 rust-gh-example-${{ matrix.artifact_prefix }}.tar.gz > rust-gh-example-${{ matrix.artifact_prefix }}.sha256
56+
fi
57+
- name: Releasing assets
58+
uses: softprops/action-gh-release@v1
59+
with:
60+
files: |
61+
target/${{ matrix.target }}/release/rust-gh-example-${{ matrix.artifact_prefix }}.tar.gz
62+
target/${{ matrix.target }}/release/rust-gh-example-${{ matrix.artifact_prefix }}.sha256
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
66+
publish-cargo:
67+
name: Publishing to Cargo
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@master
71+
- uses: actions-rs/toolchain@v1
72+
with:
73+
toolchain: stable
74+
override: true
75+
- uses: actions-rs/cargo@v1
76+
with:
77+
command: publish
78+
args: --token ${{ secrets.CARGO_API_KEY }} --allow-dirty

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
on: [push, pull_request]
2+
name: Continuous Integration
3+
4+
jobs:
5+
6+
test:
7+
name: Test Suite
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v2
12+
- name: Install Rust
13+
uses: actions-rs/toolchain@v1
14+
with:
15+
toolchain: stable
16+
profile: minimal
17+
override: true
18+
- uses: actions-rs/cargo@v1
19+
with:
20+
command: test
21+
22+
rustfmt:
23+
name: Rustfmt
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
- name: Install Rust
29+
uses: actions-rs/toolchain@v1
30+
with:
31+
toolchain: stable
32+
profile: minimal
33+
override: true
34+
components: rustfmt
35+
- name: Check formatting
36+
uses: actions-rs/cargo@v1
37+
with:
38+
command: fmt
39+
args: --all -- --check
40+
41+
clippy:
42+
name: Clippy
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v2
47+
- name: Install Rust
48+
uses: actions-rs/toolchain@v1
49+
with:
50+
toolchain: stable
51+
profile: minimal
52+
override: true
53+
components: clippy
54+
- name: Clippy Check
55+
uses: actions-rs/cargo@v1
56+
with:
57+
command: clippy
58+
args: -- -D warnings
59+
60+
coverage:
61+
name: Code coverage
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v2
66+
- name: Install stable toolchain
67+
uses: actions-rs/toolchain@v1
68+
with:
69+
toolchain: stable
70+
override: true
71+
- name: Run cargo-tarpaulin
72+
uses: actions-rs/[email protected]
73+
with:
74+
args: '--ignore-tests --out Lcov'
75+
- name: Upload to Coveralls
76+
# upload only if push on branch master
77+
if: ${{ github.event_name == 'push' && github.ref == 'ref/head/master' }}
78+
uses: coverallsapp/github-action@master
79+
with:
80+
github-token: ${{ secrets.GITHUB_TOKEN }}
81+
path-to-lcov: './lcov.info'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
This project adheres to the Rust Code of Conduct, which [can be found online](https://www.rust-lang.org/conduct.html).

0 commit comments

Comments
 (0)