diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml deleted file mode 100644 index 5407f42..0000000 --- a/.github/workflows/CI.yaml +++ /dev/null @@ -1,103 +0,0 @@ -on: - workflow_run: - workflows: [CI] - types: - - completed -permissions: - contents: read - issues: write - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: [3.9] - os: [ubuntu-latest] - - steps: - - name: 'Download artifact' - uses: actions/github-script@v5 - with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "pr" - })[0]; - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr.zip`, Buffer.from(download.data)); - - - name: 'Unzip artifact' - run: unzip pr.zip - - name: - id: pr - run: pr=$(cat pr);echo "::set-output name=pr::$pr" - - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - ref: refs/pull/${{steps.pr.outputs.pr}}/merge - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Download artifact' - uses: actions/github-script@v5 - with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "isort.diff" - })[0]; - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/isort.diff.zip`, Buffer.from(download.data)); - - - name: 'Unzip artifact' - run: unzip isort.diff.zip - - - uses: reviewdog/action-setup@v1 - - name: Run reviewdog - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - reviewdog -name="isort" -f=diff -reporter=github-pr-review isort.out || true - isort . --diff >isort.diff - - name: upload isort diff - uses: actions/upload-artifact@v2 + - name: Check files using the black formatter + uses: rickstaa/action-black@v1 + id: action_black with: - name: isort.diff - path: isort.diff - - name: Save PR number - run: | - echo ${{ github.event.number }} > ./pr - - uses: actions/upload-artifact@v2 + black_args: "." + - name: Annotate black diff changes using reviewdog + if: steps.action_black.outputs.is_formatted == 'true' + uses: reviewdog/action-suggester@v1 with: - name: pr - path: pr + tool_name: black + github_token: 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 + + - name: flake8 Lint + if: runner.os == 'Linux' + uses: reviewdog/action-flake8@v3 + with: + github_token: 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