From f1e83d4809bc1bffea298f9013c23631247908be Mon Sep 17 00:00:00 2001 From: David Mulder Date: Tue, 26 Mar 2024 13:56:57 -0600 Subject: [PATCH 1/3] Add clippy and dependabot actions Signed-off-by: David Mulder --- .github/workflows/clippy.yml | 40 +++++++++++++++++++++ .github/workflows/dependabot_auto_merge.yml | 33 +++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/clippy.yml create mode 100644 .github/workflows/dependabot_auto_merge.yml diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..d8914bb --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,40 @@ +--- +name: Clippy + +# Trigger the workflow on push or pull request +"on": + push: + branches-ignore: + - main + pull_request: + +env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.4 + with: + version: "v0.4.2" + - name: Install dependencies + run: | + sudo apt-get update && \ + sudo apt-get install -y \ + libpam0g-dev \ + libudev-dev \ + libssl-dev \ + pkg-config \ + tpm-udev \ + libtss2-dev + + - name: "Run clippy" + run: cargo clippy --all-features --all-targets + continue-on-error: false diff --git a/.github/workflows/dependabot_auto_merge.yml b/.github/workflows/dependabot_auto_merge.yml new file mode 100644 index 0000000..b3ab45f --- /dev/null +++ b/.github/workflows/dependabot_auto_merge.yml @@ -0,0 +1,33 @@ +--- +# yamllint disable rule:line-length +name: Dependabot auto-approval and auto-merge +"on": pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + # limit this to PRs opened by dependabot + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + alert-lookup: true + compat-lookup: true + - uses: actions/checkout@v4 + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Approve a PR if not already approved + run: scripts/dependabot_automerge_check.sh "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} From 49b911764b59ce963e5dfc827d1a7dcae8fba440 Mon Sep 17 00:00:00 2001 From: David Mulder Date: Tue, 26 Mar 2024 14:02:54 -0600 Subject: [PATCH 2/3] Fix clippy error Signed-off-by: David Mulder --- src/auth.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 14f2b29..2c65556 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -1689,9 +1689,9 @@ impl PublicClientApplication { } Err(MsalError::MFAPollContinue) } else { - return Err(MsalError::GeneralFailure( + Err(MsalError::GeneralFailure( "EndAuth Authentication request failed".to_string(), - )); + )) } } } From 81c8a1ce182a63f53c3b6234e9b2e9c7c80f6927 Mon Sep 17 00:00:00 2001 From: David Mulder Date: Tue, 26 Mar 2024 14:04:50 -0600 Subject: [PATCH 3/3] Add cargo build github workflow Signed-off-by: David Mulder --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..16ad40e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +--- +name: Build + +# Trigger the workflow on push or pull request +"on": + push: + branches-ignore: + - main + pull_request: + +env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.4 + with: + version: "v0.4.2" + - name: Install dependencies + run: | + sudo apt-get update && \ + sudo apt-get install -y \ + libpam0g-dev \ + libudev-dev \ + libssl-dev \ + pkg-config \ + tpm-udev \ + libtss2-dev + + - name: "Run build" + run: cargo build --all-features --all-targets + continue-on-error: false