feat: show run mode in the UI #2265
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: Format & lint | |
on: | |
push: | |
branches: [ master, submission-v* ] | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/mlcommons/mobile_app_open-formatter | |
flavor: latest=true | |
tags: type=raw,value=${{ github.run_number }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: tools/formatter | |
file: tools/formatter/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
bazel: | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: bazel | |
run: make lint/bazel | |
cpp: | |
name: C++ | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: clang | |
run: make lint/clang | |
dart: | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Cache Flutter packages | |
uses: actions/cache@v4 | |
with: | |
path: /home/mlperf/.pub-cache | |
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: ${{ runner.os }}-pub-cache- | |
- name: flutter/prepare | |
run: make flutter/prepare | |
- name: pub-get | |
run: make format/dart/pub-get | |
- name: lint/dart | |
run: make lint/dart | |
swift: | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: swift | |
run: make lint/swift | |
markdown: | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: markdown-format | |
run: make lint/markdown | |
yaml: | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: yaml | |
run: make lint/yaml | |
ts: | |
name: TypeScript | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: typescripts | |
run: make lint/ts | |
misc: | |
needs: build-image | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mlcommons/mobile_app_open-formatter:${{ github.run_number }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: configure Git | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: prohibited-extensions | |
run: make lint/prohibited-extensions | |
- name: big-files | |
run: make lint/big-files | |
- name: line-endings | |
run: make lint/line-endings |