Skip to content

Commit

Permalink
Rename files and setup CI to run on test success
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie committed May 7, 2024
1 parent b16e6e2 commit f53f837
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 73 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
workflow_run:
workflows: [Tests]
types: [completed]

env:
CARGO_INCREMENTAL: 0 # this setting is automatically applied by rust-cache but documented here for explicitness
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10

jobs:
on-failure:
runs-on: oracles-20.04
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'
on-success:
runs-on: oracles-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-build-release
cancel-in-progress: true
if: ${{ github.event.workflow_run.conclusion == 'success' }} && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Install protoc
run: sudo apt-get install -y protobuf-compiler

- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build Release
run: cargo build --all --release

- name: Debian packaging
env:
PACKAGECLOUD_API_KEY: ${{ secrets.PACKAGECLOUD_API_KEY }}
run: |
chmod +x ./.github/scripts/make_debian.sh
./.github/scripts/make_debian.sh
4 changes: 2 additions & 2 deletions .github/workflows/test.yml → .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: TESTS
name: Tests

on:
pull_request:
branches: [main]
push:
branches: ["*"]
branches: ["main"]
tags: ["*"]

env:
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/rust.yml

This file was deleted.

0 comments on commit f53f837

Please sign in to comment.