-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from neutron-org/feat/github-actions
Github actions
- Loading branch information
Showing
2 changed files
with
116 additions
and
0 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,37 @@ | ||
name: PR | ||
|
||
on: | ||
pull_request: | ||
types: [assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, synchronize, converted_to_draft, ready_for_review, locked, unlocked, review_requested, review_request_removed] | ||
issue_comment: | ||
types: [created] | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
pr_commented: | ||
# This job only runs for pull request comments | ||
name: PR comment | ||
if: ${{ github.event.issue.pull_request }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Notification | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
message: | | ||
User @${{ github.actor }} commented PR #${{ github.event.issue.number }} "${{ github.event.issue.title }}" (${{ github.event.issue.pull_request.html_url }}) | ||
pull_requests_and_review: | ||
name: Pull request action or review | ||
if: ${{ !github.event.issue.pull_request }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Notification | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
message: | | ||
User @${{ github.actor }} updated PR #${{ github.event.number }} "${{ github.event.pull_request.title }}", action "${{ github.event.action }}" (${{ github.event.pull_request.html_url }}) |
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,79 @@ | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
name: tests | ||
|
||
jobs: | ||
clippy: | ||
name: Actions - clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.60.0 | ||
components: clippy | ||
profile: minimal | ||
override: true | ||
- run: cargo fetch --verbose | ||
- run: cargo clippy --all --all-targets -- -D warnings | ||
|
||
rustfmt: | ||
name: Actions - rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.60.0 | ||
components: rustfmt | ||
profile: minimal | ||
override: true | ||
- run: cargo fmt -- --check | ||
|
||
checkbuild: | ||
name: Actions - check artifacts hash sums | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.60.0 | ||
components: rustfmt | ||
profile: minimal | ||
override: true | ||
- name: Get hash of checksum file | ||
id: checksum | ||
run: echo "::set-output name=DATA::$(shasum -a 256 ./artifacts/checksums.txt | cut -f1 -d ' ')" | ||
- name: Rebuild artifacts | ||
run: make schema && ./build_release.sh | ||
- name: Verify | ||
run: if [[ "${{steps.checksum.outputs.DATA}}" != $(shasum -a 256 ./artifacts/checksums.txt | cut -f1 -d ' ') ]]; then return 2; fi | ||
|
||
unit-test: | ||
name: Actions - unit test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macOS-latest, ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.60.0 | ||
profile: minimal | ||
- run: cargo fetch --verbose | ||
- run: cargo build | ||
- run: cargo test --verbose --all | ||
env: | ||
RUST_BACKTRACE: 1 |