Merge pull request #259 from EmixamPP/dependabot/cargo/derive_more-2.1.1 #42
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| jobs: | |
| build: | |
| name: Check | |
| uses: ./.github/workflows/build.yml | |
| pr: | |
| name: PR | |
| needs: build | |
| runs-on: ubuntu-latest | |
| env: | |
| MESSAGE_FILE: ./message.md | |
| steps: | |
| - name: Check if in PR | |
| uses: insurgent-lab/[email protected] | |
| id: is-pr | |
| - name: Create PR comment | |
| id: create-comment | |
| if: ${{ steps.is-pr.outputs.result == 'true' }} | |
| run: | | |
| function outcome_emoji() { | |
| if [ "$1" == "success" ]; then | |
| echo ':white_check_mark:' | |
| elif [ "$1" == "skipped" ]; then | |
| echo ':heavy_minus_sign:' | |
| else | |
| echo ':x:' | |
| fi | |
| } | |
| function write() { | |
| echo "$1" >> ${{ env.MESSAGE_FILE }} | |
| } | |
| write "## :arrow_right: Commit ${{ github.sha }}" | |
| write "## :hammer_and_wrench: Building result: $(outcome_emoji ${{ needs.build.outputs.build }})" | |
| if [ "${{ needs.build.outputs.build }}" == "success" ]; then | |
| write "### :package: Artifacts:" | |
| write "1. [Download the tarball](${{ needs.build.outputs.artifact-url }})" | |
| write "2. \`unzip linux-enable-ir-emitter*.tar.gz.zip\`" | |
| write "3. [Execute the install instructions](https://github.com/EmixamPP/linux-enable-ir-emitter?tab=readme-ov-file#installation)" | |
| fi | |
| write "" | |
| write "## :test_tube: Tests results: $(outcome_emoji ${{ needs.build.outputs.tests }})" | |
| write "## :stethoscope: Clippy results: $(outcome_emoji ${{ needs.build.outputs.clippy }})" | |
| write "## :art: Format results: $(outcome_emoji ${{ needs.build.outputs.format }})" | |
| write "## :books: Doc results: $(outcome_emoji ${{ needs.build.outputs.doc }})" | |
| write "## :scissors: Shear results: $(outcome_emoji ${{ needs.build.outputs.shear }})" | |
| - name: Comment on PR | |
| uses: thollander/actions-comment-pull-request@v3 | |
| if: ${{ steps.create-comment.outcome == 'success' }} | |
| with: | |
| comment-tag: bot_comment | |
| mode: recreate | |
| file-path: ${{ env.MESSAGE_FILE }} |