diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfdf703..7e34c53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ env: jobs: build: - name: "CI Build" + name: CI Build runs-on: ubuntu-latest strategy: matrix: @@ -35,25 +35,20 @@ jobs: - x86_64-unknown-linux-gnu steps: - - name: "Checkout" + - name: Checkout uses: actions/checkout@v3 - - name: "Toolchain setup" - uses: actions-rs/toolchain@v1 + - name: Toolchain setup + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.TARGET }} - override: true - - name: "Build" - uses: actions-rs/cargo@v1 - with: - command: build + - name: Cross setup + run: cargo install cross - - name: "Test" - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: test - args: --target=${{ matrix.TARGET }} + - name: Build + run: cross build + + - name: Test + run: cross test --target=${{ matrix.TARGET }} diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 725bc8c..3e80376 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -41,22 +41,16 @@ jobs: uses: actions/checkout@v3 - 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 run: cargo install clippy-sarif sarif-fmt - name: Run rust-clippy - run: - cargo clippy - --all-targets - --all-features - --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt + run: cargo clippy --all-targets --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt continue-on-error: true - name: Upload analysis results to GitHub diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index 32148a9..1b4bda1 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -16,11 +16,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable components: rustfmt - override: true - uses: mbrobbel/rustfmt-check@master with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9572261..a307ff2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,8 @@ on: jobs: tag-release: - name: "Tag Release Build" - runs-on: "ubuntu-latest" + name: Tag Release Build + runs-on: ubuntu-latest strategy: matrix: rust: [stable] @@ -18,32 +18,26 @@ jobs: - x86_64-unknown-linux-gnu steps: - - name: "Checkout" + - name: Checkout uses: actions/checkout@v3 - - name: "Toolchain setup" - uses: actions-rs/toolchain@v1 + - name: Toolchain setup + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.TARGET }} - override: true - - name: "Build" - uses: actions-rs/cargo@v1 - with: - command: build - args: --release + - name: Cross setup + run: cargo install cross - - name: "Test" - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: test - args: --target=${{ matrix.TARGET }} + - name: Test + run: cross test --target=${{ matrix.TARGET }} + + - name: Build + run: cross build --release release-lib: - name: "Release Lib to crates.io" + name: Release Lib to crates.io runs-on: ubuntu-latest needs: [tag-release] if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false ) @@ -54,27 +48,22 @@ jobs: - x86_64-unknown-linux-gnu steps: - - name: "Checkout" + - name: Checkout uses: actions/checkout@v3 - - name: "Toolchain setup" - uses: actions-rs/toolchain@v1 + - name: Toolchain setup + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.TARGET }} - override: true - - name: "Publish API to crates.io" + - name: Publish API to crates.io env: CARGO_REGISTRY_TOKEN: "${{ secrets.CRATES_TOKEN }}" - uses: actions-rs/cargo@v1 - with: - command: publish - args: -p alienware + run: cargo publish -p alienware - - name: "Create CLI Release" - uses: "marvinpinto/action-automatic-releases@latest" + - name: Create CLI Release + uses: marvinpinto/action-automatic-releases@latest with: automatic_release_tag: "latest" title: "Release ${{ github.ref_name }}" @@ -89,7 +78,7 @@ jobs: shell: bash release-cli-crates: - name: "Release CLI to crates.io" + name: Release CLI to crates.io runs-on: ubuntu-latest needs: [release-lib] if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false ) @@ -100,33 +89,28 @@ jobs: - x86_64-unknown-linux-gnu steps: - - name: "Checkout" + - name: Checkout uses: actions/checkout@v3 - - name: "Toolchain setup" - uses: actions-rs/toolchain@v1 + - name: Toolchain setup + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.TARGET }} - override: true - - name: "Publish CLI to crates.io" + - name: Publish CLI to crates.io env: CARGO_REGISTRY_TOKEN: "${{ secrets.CRATES_TOKEN }}" - uses: actions-rs/cargo@v1 - with: - command: publish - args: -p alienware_cli + run: cargo publish -p alienware_cli # Kick off the workflow in this repo that will generate the snapcraft yaml file release-cli-snap: - name: "Initiate release of the alienware cli application" + name: Initiate release of the alienware cli application runs-on: ubuntu-latest needs: [tag-release] steps: - - name: "Repository Dispatch" + - name: Repository Dispatch uses: benc-uk/workflow-dispatch@v1 with: token: ${{ secrets.PAT }}