feat(ci): add autofix.ci action on PR
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 24 Jun 2024 17:12:02 +0000 (19:12 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 24 Jun 2024 17:12:02 +0000 (19:12 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.github/workflows/autofix.yml [new file with mode: 0644]
.github/workflows/ci.yml

diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml
new file mode 100644 (file)
index 0000000..a988c47
--- /dev/null
@@ -0,0 +1,57 @@
+name: autofix.ci
+on:
+  pull_request:
+  push:
+    branches: ['main']
+permissions:
+  contents: read
+
+jobs:
+  autofix-ocpp-server:
+    runs-on: ubuntu-latest
+    defaults:
+      run:
+        working-directory: tests/ocpp-server
+    steps:
+      - uses: actions/checkout@v4
+      - uses: actions/setup-python@v5
+        with:
+          python-version: 3.12
+      - run: pip install poetry
+      - run: poetry install --no-root
+      - run: poetry run task format
+
+      - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
+  autofix-simulator:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - uses: pnpm/action-setup@v4
+      - uses: actions/setup-node@v4
+        with:
+          node-version: lts
+          cache: 'pnpm'
+
+      - run: pnpm install --ignore-scripts --frozen-lockfile
+      - run: pnpm format
+
+      - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
+  autofix-dashboard:
+    runs-on: ubuntu-latest
+    defaults:
+      run:
+        working-directory: ui/web
+    steps:
+      - uses: actions/checkout@v4
+      - uses: pnpm/action-setup@v4
+      - uses: actions/setup-node@v4
+        with:
+          node-version: lts
+          cache: 'pnpm'
+
+      - run: pnpm install --ignore-scripts --frozen-lockfile
+      - run: |
+          pnpm format
+          pnpm lint:fix
+
+      - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
index c7e5591e87392e70d14355a9a34505941f7ddb99..3cc5a31dc7bbc76a5409c89e024adebf56ff6a55 100644 (file)
@@ -38,9 +38,7 @@ jobs:
         with:
           python-version: ${{ matrix.python }}
       - name: Install Poetry
-        run: |
-          python -m pip install --upgrade pip
-          pip install poetry
+        run: pip install poetry
       - name: Install Dependencies
         run: poetry install --no-root
       - name: Lint