From 2b721609f27403db1b5bf5654fc22b632db4a355 Mon Sep 17 00:00:00 2001 From: Alexei Pastuchov Date: Wed, 20 Sep 2023 14:46:33 +0200 Subject: [PATCH 1/3] Fix clippy error useless_vec Removed useless vec! macro Signed-off-by: Alexei Pastuchov --- src/enclave_proc_comm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enclave_proc_comm.rs b/src/enclave_proc_comm.rs index a098614f..7fd12e7c 100644 --- a/src/enclave_proc_comm.rs +++ b/src/enclave_proc_comm.rs @@ -190,7 +190,7 @@ where // Get the number of expected replies. let mut num_replies_expected = comms.len() - num_errors; - let mut events = vec![EpollEvent::empty(); 1]; + let mut events = [EpollEvent::empty(); 1]; while num_replies_expected > 0 { let num_events = loop { From 39db2953db21b0239de681c5a11f689da503a67d Mon Sep 17 00:00:00 2001 From: Erdem Meydanli Date: Fri, 7 Apr 2023 18:09:37 +0000 Subject: [PATCH 2/3] ci: remove license check jobs from the workflow file. Signed-off-by: Erdem Meydanli --- .github/workflows/ci.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26734610..857d0bdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,29 +50,3 @@ jobs: - run: cargo install --locked --version "~0.17" cargo-audit - run: cargo audit --ignore RUSTSEC-2020-0159 --ignore RUSTSEC-2020-0071 - license: - name: Check dependencies for licenses - runs-on: ubuntu-latest - outputs: - license_changed: ${{ steps.license_diff.outputs.license_changed }} - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: cargo install --locked --version "~0.5" cargo-about - - run: cargo about generate --workspace --output-file "${{ runner.temp }}/licenses.html" about.hbs - - id: license_diff - run: | - if diff -q THIRD_PARTY_LICENSES_RUST_CRATES.html ${{ runner.temp }}/licenses.html ; then - echo "license_changed=NO" >> $GITHUB_OUTPUT - else - echo "license_changed=YES" >> $GITHUB_OUTPUT - fi - - license_update: - name: Check if rust crates license files needs updates - runs-on: ubuntu-latest - needs: license - continue-on-error: true - steps: - - run: test "${{ needs.license.outputs.license_changed }}" == "NO" From fc4cb9d5ea42d52ae4c6459a6f7540a0bf99f3eb Mon Sep 17 00:00:00 2001 From: Erdem Meydanli Date: Fri, 7 Apr 2023 13:05:10 +0000 Subject: [PATCH 3/3] workflows: enable automatic license file generation Add license_update.yml workflow to auto-generate THIRD_PARTY_LICENSES_RUST_CRATES.html nightly. Signed-off-by: Erdem Meydanli --- .github/workflows/license_update.yml | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/license_update.yml diff --git a/.github/workflows/license_update.yml b/.github/workflows/license_update.yml new file mode 100644 index 00000000..fb201d50 --- /dev/null +++ b/.github/workflows/license_update.yml @@ -0,0 +1,54 @@ +name: Update THIRD_PARTY_LICENSES_RUST_CRATES.html +on: + schedule: + # Run the job every midnight. + - cron: '0 0 * * *' + workflow_dispatch: + +permissions: + contents: read + +jobs: + update_license: + name: Update THIRD_PARTY_LICENSES_RUST_CRATES.html + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + # Clone the repository and check if THIRD_PARTY_LICENSES_RUST_CRATES.html + # is up-to-date. + - uses: actions/checkout@v3.5.0 + with: + persist-credentials: false + - run: cargo install --locked --version "~0.5" cargo-about + - run: cargo about generate --workspace --output-file THIRD_PARTY_LICENSES_RUST_CRATES.html about.hbs + - id: checkgitdiff # Early exit if there is no diff. + run: | + git diff --exit-code --quiet + [ $? -eq 0 ] && { + echo "THIRD_PARTY_LICENSES_RUST_CRATES.html is up-to-date." + gh run cancel ${{ github.run_id }} + gh run watch ${{ github.run_id }} + } + continue-on-error: true + # Delete existing rust-crates-license-update branch. + - uses: dawidd6/action-delete-branch@v3 + with: + github_token: ${{github.token}} + branches: rust-crates-license-update + # Create a new PR. + - uses: gr2m/create-or-update-pull-request-action@v1.x + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # https://github.com/actions/checkout/pull/1184 + author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + branch: rust-crates-license-update + title: 'doc: update THIRD_PARTY_LICENSES_RUST_CRATES.html' + body: > + THIRD_PARTY_LICENSES_RUST_CRATES.html needs an update. This is an automatically generated PR by + a GitHub Action. + commit-message: 'doc: update THIRD_PARTY_LICENSES_RUST_CRATES.html' + +