name: Rust on: push: branches: [main] pull_request: branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: env: CARGO_TERM_COLOR: always jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v1 with: working-directory: ./rust - name: Build run: cd rust && cargo build --verbose test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v1 with: working-directory: ./rust - name: Run tests run: cd rust && cargo test --verbose lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v1 with: working-directory: ./rust - name: Clippy run: cd rust && cargo clippy -- -D warnings - name: Lint run: cd rust && cargo fmt -- --check complete: runs-on: ubuntu-latest needs: [build, test, lint] steps: - name: Rust tests successful if: success() uses: peter-evans/repository-dispatch@v1 with: token: ${{ secrets.ACTIONS_PAT }} repository: ${{ github.repository }} event-type: rust-tests-successful