From 5491731d164fdfa44cbf8f1a10a9734401ce8049 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Tue, 18 Jul 2023 08:50:14 +0300 Subject: [PATCH] fix yaml formatting & update spellcheck actions --- .github/workflows/codeql-analysis.yml | 70 +++++++-------- .github/workflows/dependabot-auto-merge.yml | 2 +- .github/workflows/dependency-review.yml | 6 +- .github/workflows/docs.yml | 33 ++++---- .github/workflows/int.yml | 94 ++++++++++----------- .github/workflows/publish.yml | 8 +- .github/workflows/s2i-build.yml | 22 ++--- .github/workflows/style.yml | 44 +++++----- .github/workflows/unit.yml | 48 +++++------ 9 files changed, 163 insertions(+), 164 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 97dd28e4..e62f8301 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ on: # The branches below must be a subset of the branches above branches: [master] schedule: - - cron: '0 19 * * 3' + - cron: "0 19 * * 3" jobs: analyze: @@ -24,48 +24,48 @@ jobs: matrix: # Override automatic language detection by changing the below list # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['python'] + language: ["python"] # Learn more... # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 + - name: Checkout repository + uses: actions/checkout@v3 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + #- run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 2b9c0a06..b3211b67 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -22,7 +22,7 @@ jobs: with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs - if: ${{ steps.metadata.outputs.package-ecosystem == 'pip' || steps.metadata.outputs.package-ecosystem == 'github_actions' }} + if: ${{ steps.metadata.outputs.package-ecosystem == 'pip' || steps.metadata.outputs.package-ecosystem == 'github_actions' }} run: gh pr review --approve "$PR_URL" && gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 8fd361bd..970506c6 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -4,7 +4,7 @@ # # Source repository: https://github.com/actions/dependency-review-action # Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement -name: 'Dependency Review' +name: "Dependency Review" on: [pull_request] permissions: @@ -14,9 +14,9 @@ jobs: dependency-review: runs-on: ubuntu-latest steps: - - name: 'Checkout Repository' + - name: "Checkout Repository" uses: actions/checkout@v3 - - name: 'Dependency Review' + - name: "Dependency Review" uses: actions/dependency-review-action@v3 with: fail-on-severity: moderate diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 913f6970..78c41898 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,13 +8,13 @@ jobs: max-parallel: 4 matrix: os: [ubuntu-latest] - + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.33.0 - name: Spellcheck + - uses: actions/checkout@v3 + - uses: rojopolis/spellcheck-github-actions@0.33.1 + name: Spellcheck code_docs: strategy: @@ -22,19 +22,18 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.10"] - + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Run docs tests - run: tox -e docs - \ No newline at end of file + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Run docs tests + run: tox -e docs diff --git a/.github/workflows/int.yml b/.github/workflows/int.yml index de5dc79a..8f9114b7 100644 --- a/.github/workflows/int.yml +++ b/.github/workflows/int.yml @@ -10,7 +10,7 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.10"] - + runs-on: ${{ matrix.os }} name: Integration Tests @@ -20,54 +20,54 @@ jobs: image: registry:2 ports: - 5000:5000 - + steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install requirements - run: | - pip install aiohttp - pip install requests + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install requirements + run: | + pip install aiohttp + pip install requests + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: network=host + + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + push: true + file: ./Dockerfile + tags: localhost:5000/beacon-python:latest + cache-from: localhost:5000/beacon-python:latest + cache-to: type=local,dest=/tmp/.buildx-cache - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - driver-opts: network=host - - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - push: true - file: ./Dockerfile - tags: localhost:5000/beacon-python:latest - cache-from: localhost:5000/beacon-python:latest - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Start Services - run: | - docker-compose -f deploy/test/docker-compose.yml up -d - sleep 10 - docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata.json - docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata_registered.json - docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata_controlled.json - docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata_controlled1.json + - name: Start Services + run: | + docker-compose -f deploy/test/docker-compose.yml up -d + sleep 10 + docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata.json + docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata_registered.json + docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata_controlled.json + docker exec test_beacon_1 beacon_init /exdata/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.gz /exdata/example_metadata_controlled1.json - - name: Run Integration test - run: | - python deploy/test/run_tests.py + - name: Run Integration test + run: | + python deploy/test/run_tests.py - - name: Collect logs from docker - if: ${{ failure() }} - run: cd deploy && docker-compose logs --no-color -t > ../tests/dockerlogs || true + - name: Collect logs from docker + if: ${{ failure() }} + run: cd deploy && docker-compose logs --no-color -t > ../tests/dockerlogs || true - - name: Persist log files - if: ${{ failure() }} - uses: actions/upload-artifact@v3 - with: - name: test_debugging_help - path: tests + - name: Persist log files + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test_debugging_help + path: tests diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7dd68814..a3c442e0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ on: push: branches: [master] tags: - - 'v*' + - "v*" jobs: push_to_registry: @@ -18,10 +18,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - + - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} @@ -35,7 +35,7 @@ jobs: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} type=raw,value=stage,enable=${{ github.ref == format('refs/heads/{0}', 'dev') }} type=ref,event=tag - + - name: Build and push uses: docker/build-push-action@v4 with: diff --git a/.github/workflows/s2i-build.yml b/.github/workflows/s2i-build.yml index eb9528fd..5389b2f7 100644 --- a/.github/workflows/s2i-build.yml +++ b/.github/workflows/s2i-build.yml @@ -8,19 +8,19 @@ jobs: max-parallel: 4 matrix: os: [ubuntu-latest] - + runs-on: ${{ matrix.os }} name: Integration Tests - + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Install requirements - run: | - wget https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz - tar -xvf source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz - sudo cp s2i /usr/local/bin - - name: Build image - run: | - s2i build . centos/python-38-centos7 cscfi/beacon-python + - name: Install requirements + run: | + wget https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz + tar -xvf source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz + sudo cp s2i /usr/local/bin + - name: Build image + run: | + s2i build . centos/python-38-centos7 cscfi/beacon-python diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 3b2095f3..17004d8e 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,28 +9,28 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.10"] - + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test flake8 syntax with tox - run: tox -e flake8 - - name: Do bandit static check with tox - run: tox -e bandit - - name: Black formatting check - run: tox -e black - - name: Install libcurl-devel - run: | - sudo apt-get update - sudo apt-get install libcurl4-openssl-dev - - name: Type hints check - run: tox -e mypy + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Test flake8 syntax with tox + run: tox -e flake8 + - name: Do bandit static check with tox + run: tox -e bandit + - name: Black formatting check + run: tox -e black + - name: Install libcurl-devel + run: | + sudo apt-get update + sudo apt-get install libcurl4-openssl-dev + - name: Type hints check + run: tox -e mypy diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index a691ae58..e85f0033 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -3,7 +3,7 @@ name: Python Unit Tests on: push: schedule: - - cron: '0 7 * * 1' + - cron: "0 7 * * 1" jobs: unit_test: @@ -12,29 +12,29 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.10"] - + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install libcurl-devel - run: | - sudo apt-get update - sudo apt-get install libcurl4-openssl-dev - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions coverage - - name: Run unit tests for python 3.10 - run: | - tox -e unit_tests - coverage lcov -o lcov.info - - name: Send coverage to coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.github_token }} - path-to-lcov: lcov.info + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install libcurl-devel + run: | + sudo apt-get update + sudo apt-get install libcurl4-openssl-dev + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions coverage + - name: Run unit tests for python 3.10 + run: | + tox -e unit_tests + coverage lcov -o lcov.info + - name: Send coverage to coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + path-to-lcov: lcov.info