-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create workspace and add CI
- Loading branch information
Showing
82 changed files
with
5,778 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,137 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: -D warnings | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
# Build caching action | ||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Install rustfmt | ||
run: rustup component add rustfmt | ||
|
||
- name: Install Cargo.toml linter | ||
uses: baptiste0928/cargo-install@v1 | ||
with: | ||
crate: cargo-toml-lint | ||
version: "0.1" | ||
|
||
- name: Run Cargo.toml linter | ||
run: git ls-files | grep Cargo.toml$ | xargs --verbose -n 1 cargo-toml-lint | ||
|
||
- name: Check formatting | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all --verbose -- --check | ||
|
||
- name: Check build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --verbose --all-targets | ||
|
||
- name: Check Clippy Lints | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --verbose --all-targets | ||
|
||
- name: Run tests (default features) | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --verbose --all-targets | ||
|
||
- name: Run tests (no default features) | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --verbose --all-targets --no-default-features | ||
|
||
- name: Notify if Job Fails | ||
uses: ravsamhq/notify-slack-action@v1 | ||
if: always() && github.ref == 'refs/heads/master' | ||
with: | ||
status: ${{ job.status }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
notification_title: '{workflow} has {status_message}' | ||
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>' | ||
footer: '' | ||
notify_when: 'failure' | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} | ||
|
||
publish: | ||
# Only do this job if publishing a release | ||
needs: build | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Verify tag version | ||
run: | | ||
curl -sSLf "$(curl -sSLf https://github.com/gitapi/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d\" -f 4)" -L -o dasel && chmod +x dasel | ||
mv ./dasel /usr/local/bin/dasel | ||
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} derive/Cargo.toml | ||
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} indexer/Cargo.toml | ||
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} lib/Cargo.toml | ||
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} schema/Cargo.toml | ||
- name: Publish crate | ||
uses: katyo/publish-crates@v1 | ||
with: | ||
publish-delay: 30000 | ||
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
|
||
- name: Notify if Job Fails | ||
uses: ravsamhq/notify-slack-action@v1 | ||
if: always() | ||
with: | ||
status: ${{ job.status }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
notification_title: '{workflow} has {status_message}' | ||
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>' | ||
footer: '' | ||
notify_when: 'failure' | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |
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,14 @@ | ||
name: Nightly Cargo Audit | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
cargo_audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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 @@ | ||
**/target |
Oops, something went wrong.