chore(deps): update dependency org.scalameta:scalafmt-cli_2.13 to v3.8.4 #485
This file contains 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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build_test_and_format: | |
# virtual environments: https://github.com/actions/virtual-environments | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Remove unnecessary files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
# Installs missing package for the default C++ clangd toolchain for Bazel | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libtinfo5 | |
version: 1.0 | |
# Caches and restores the bazelisk download directory, the bazel build directory. | |
- name: Cache bazel | |
uses: actions/[email protected] | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
~/.cache/bazel | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
# Checks-out your repository under $GITHUB_WORKSPACE, which is the CWD for | |
# the rest of the steps | |
- uses: actions/checkout@v4 | |
# If I need to run the pipeline again after a step pushes a new commit, uncomment the following lines | |
# with: | |
# token: ${{ secrets.CODE_FORMATTER_BOT_CONTENTS_TOKEN }} | |
# format | |
- name: Test if the files are correctly formatted | |
id: testFormat | |
if: github.actor != 'code-formatter-bot[bot]' | |
run: bazel test //tools/format/... | |
continue-on-error: true | |
- name: Apply formatting if the test fails | |
id: applyFormat | |
if: always() && steps.testFormat.outcome == 'failure' | |
run: bazel run //tools/format:format | |
- name: Test if the files are correctly formatted after applying the formatting | |
id: testFormatAfterApply | |
if: always() && steps.testFormat.outcome == 'failure' && steps.applyFormat.outcome == 'success' | |
run: bazel test //tools/format/... | |
# build | |
- name: Build the code | |
run: bazel build //... | |
# test | |
- name: Test the code | |
run: bazel test //... -- -//tools/... # Exclude tools from testing | |
- name: Commit the formatting changes # always try to commit the formatting changes because bazel build can also modify | |
if: always() | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Apply formatting from rules_lint" | |
commit_user_name: code-formatter-bot[bot] | |
commit_user_email: code-formatter-bot[bot]@users.noreply.github.com | |
commit_author: code-formatter-bot[bot] <code-formatter-bot[bot]@users.noreply.github.com> |