diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2859011d..c17c0b73 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,7 @@ name: Test on Push - -on: # Trigger the workflow on push or pull request, # but only for the main branch +on: push: branches: - main @@ -14,41 +13,47 @@ jobs: test_Ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: dependencies - run: | - sudo apt-get update - sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev - - name: Test - run: | - cargo test - cargo test --features flatpak + - uses: actions/checkout@v4 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: dependencies + run: | + sudo apt-get update + sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy + - name: Test + run: | + cargo test + cargo test --features flatpak test_Windows: - runs-on: windows-latest + runs-on: windows-latest steps: - - uses: actions/checkout@v3 - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Rust Cache - id: rust_cache - uses: Swatinem/rust-cache@v2 - - name: Test - run: cargo test + - uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy + - name: Rust Cache + id: rust_cache + uses: Swatinem/rust-cache@v2 + - name: Test + run: cargo test # test_Macos: - # runs-on: macos-latest + # runs-on: macos-latest # steps: - # - uses: actions/checkout@v3 - # - name: Install latest stable - # uses: actions-rs/toolchain@v1 + # - uses: actions/checkout@v4 + # - name: Install Rust toolchain + # uses: dtolnay/rust-toolchain@stable # with: # toolchain: stable + # components: clippy # - name: Rust Cache # id: rust_cache - # uses: Swatinem/rust-cache@v2 + # uses: Swatinem/rust-cache@v2 # - name: Test # run: cargo test - diff --git a/.github/workflows/release_on_v_tag.yml b/.github/workflows/release_on_v_tag.yml index ddc24ec8..5c8c23c7 100644 --- a/.github/workflows/release_on_v_tag.yml +++ b/.github/workflows/release_on_v_tag.yml @@ -1,9 +1,14 @@ +# rust-clippy is a tool that runs a bunch of lints to catch common +# mistakes in your Rust code and help improve your Rust code. +# More details at https://github.com/rust-lang/rust-clippy +# and https://rust-lang.github.io/rust-clippy/ name: Create Release Builds on: push: tags: - "v.*.*.*" # matches v.1.0.1 etc + jobs: once: name: Create GitHub release @@ -11,9 +16,12 @@ jobs: outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Create a release id: create_release - uses: actions/create-release@v1 + uses: ncipollo/release-action@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -36,26 +44,26 @@ jobs: - os: windows-latest file: target/release/boilr.exe asset_name: windows_BoilR.exe - strip: false + strip: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies if: ${{ matrix.os == 'ubuntu-latest'}} run: | - sudo apt-get update + sudo apt-get update sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev binutils - name: Rust Cache id: rust_cache uses: Swatinem/rust-cache@v2 - name: Build Release Version - run: cargo build --release + run: cargo build --release - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1 + uses: ncipollo/release-action@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.once.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ matrix.file }} - asset_name: ${{ matrix.asset_name }} - asset_content_type: application/octet-stream + artifact_path: ${{ github.workspace }}/${{ matrix.file }} + artifact_name: ${{ matrix.asset_name }} + artifact_content_type: application/octet-stream diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index 340b35b0..f69d8387 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -1,19 +1,12 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# rust-clippy is a tool that runs a bunch of lints to catch common -# mistakes in your Rust code and help improve your Rust code. -# More details at https://github.com/rust-lang/rust-clippy -# and https://rust-lang.github.io/rust-clippy/ - name: rust-clippy analyze on: + # Trigger the workflow on push or pull request, + # but only for the main branch push: branches: [ "main" ] pull_request: - # The branches below must be a subset of the branches above + # The branches below must be a subset of the branches above branches: [ "main" ] schedule: - cron: '16 19 * * 6' @@ -25,31 +18,28 @@ jobs: permissions: contents: read security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + actions: read + steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: stable components: clippy - override: true - - name: Install required cargo + - name: Install required cargo tools run: cargo install clippy-sarif sarif-fmt - name: Run rust-clippy - run: - cargo clippy - --all-features - --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt + run: | + cargo clippy --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt continue-on-error: true - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: rust-clippy-results.sarif wait-for-processing: true