diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml index 2020612..4089e1b 100644 --- a/.github/workflows/formatter.yml +++ b/.github/workflows/formatter.yml @@ -6,11 +6,19 @@ jobs: linter_name: name: Code formatter runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + fail-fast: true steps: - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - run: pip install black isort - name: Format code with black and isort run: | - pip install black isort isort . black . - name: Commit changes diff --git a/.github/workflows/smokeshow.yml b/.github/workflows/smokeshow.yml index 40caa43..a6d6b75 100644 --- a/.github/workflows/smokeshow.yml +++ b/.github/workflows/smokeshow.yml @@ -22,7 +22,10 @@ jobs: Smokeshow: needs: Context runs-on: ubuntu-latest - + strategy: + matrix: + python-version: ["3.11"] + fail-fast: true steps: - name: Dump GitHub context env: @@ -30,15 +33,12 @@ jobs: run: echo "$GITHUB_CONTEXT" - uses: actions/setup-python@v5 with: - python-version: '3.11' - + python-version: ${{ matrix.python-version }} - run: pip install smokeshow - - uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: tests.yml commit: ${{ github.event.workflow_run.head_sha }} - - run: smokeshow upload coverage env: SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 0000000..f2dd48a --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,23 @@ +name: SonarCloud Scan +on: + workflow_run: + workflows: [Test] + types: [completed] + +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: actions/download-artifact@master + with: + name: coverage + path: coverage + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c04431f..d44fd95 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: pip install -r requirements.txt pip install -r requirements-tests.txt - name: Test - run: python -m pytest -n auto tests --cov=src --cov=tests --cov-report=html:coverage --cov-fail-under=85 + run: python -m pytest -n auto tests --cov=src --cov=tests --cov-report=xml --cov-report=html:coverage --cov-fail-under=85 - name: Store coverage files uses: actions/upload-artifact@v3 with: diff --git a/README.md b/README.md index 8d7aa76..38b5b7a 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,77 @@ # NTHU-Data-API -[![CodeFactor](https://www.codefactor.io/repository/github/nthu-sa/nthu-data-api/badge)](https://www.codefactor.io/repository/github/nthu-sa/nthu-data-api) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Smokeshow coverage](https://coverage-badge.samuelcolvin.workers.dev/NTHU-SA/NTHU-Data-API.svg)](https://coverage-badge.samuelcolvin.workers.dev/redirect/NTHU-SA/NTHU-Data-API) +
+ NTHU-Data-API is a project designed for NTHU developers.
+
+ It provides an easy way to fetch data from the NTHU website.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+