-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first try with reusable workflow #68
- Loading branch information
Showing
8 changed files
with
159 additions
and
117 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/security-audit.yml → .github/workflows/ci-cargo-audit.yml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Security audit | ||
name: ci-cargo-audit | ||
on: | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
|
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,23 @@ | ||
name: ci-pr | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
call-workflow-rust-cache: | ||
name: run rust-cache action | ||
uses: mdpadberg/multi-cf/.github/workflows/rust-cache.yml@main | ||
call-workflow-clippy: | ||
name: run clippy github action | ||
needs: [call-workflow-rust-cache] | ||
uses: mdpadberg/multi-cf/.github/workflows/clippy.yml@main | ||
secrets: inherit | ||
call-workflow-unit-tests: | ||
name: run unit tests | ||
needs: [call-workflow-rust-cache] | ||
uses: mdpadberg/multi-cf/.github/workflows/unit-tests.yml@main | ||
call-workflow-integration-tests: | ||
name: run integration tests | ||
needs: [call-workflow-rust-cache] | ||
uses: mdpadberg/multi-cf/.github/workflows/integration-tests@main |
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
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,27 @@ | ||
name: run clippy github action | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
token: | ||
required: true | ||
|
||
jobs: | ||
clippy: | ||
name: run clippy github action | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Install Rust with cargo | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
- name: Restore cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: ubuntu-latest-x86_64-unknown-linux-gnu | ||
- uses: giraffate/clippy-action@v1 | ||
with: | ||
reporter: 'github-pr-review' | ||
github_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,25 @@ | ||
name: run integration tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
integration-tests: | ||
name: run integration tests | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Install Rust with cargo | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
target: x86_64-unknown-linux-gnu | ||
- name: Restore cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: ubuntu-latest-x86_64-unknown-linux-gnu | ||
- name: Run integration tests | ||
run: docker-compose up --exit-code-from mcf --build |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
name: run rust-cache action | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
rust-cache: | ||
name: run rust-cache action | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
rust-target: x86_64-apple-darwin | ||
- os: ubuntu-latest | ||
rust-target: x86_64-unknown-linux-gnu | ||
- os: windows-latest | ||
rust-target: x86_64-pc-windows-gnu | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Rust with cargo | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
- name: Restore cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: ${{ matrix.os }}-${{ matrix.rust-target }} |
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,38 @@ | ||
name: run unit tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
unit-tests: | ||
name: run unit tests | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
rust-target: x86_64-apple-darwin | ||
- os: ubuntu-latest | ||
rust-target: x86_64-unknown-linux-gnu | ||
- os: windows-latest | ||
rust-target: x86_64-pc-windows-gnu | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Set autocrlf | ||
shell: bash | ||
run: | | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
git config --global core.autocrlf false | ||
fi | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Install Rust with cargo | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
target: ${{ matrix.rust-target }} | ||
- name: Restore cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: ${{ matrix.os }}-${{ matrix.rust-target }} | ||
- name: Run unit tests | ||
run: cargo test --verbose |