68 support debloating and adding readme to db (#69) #146
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will install Deno then run `deno lint` and `deno test`. | |
# For more information see: https://github.com/denoland/setup-deno | |
name: Deno | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: Phase-2 | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
- name: Setup Deno | |
# uses: denoland/setup-deno@v1 | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Setup .env file and Install Dependencies | |
run: | | |
echo "GITHUB_TOKEN=${{ secrets.API_TOKEN }}" >> .env | |
echo "LOG_LEVEL=info" >> .env | |
echo "LOG_FILE=/tmp/checker.log" >> .env | |
# Uncomment this step to verify the use of 'deno fmt' on each commit. | |
- name: Verify formatting | |
run: deno fmt --check | |
- name: Run linter | |
run: deno lint | |
- name: Run tests | |
run: deno test -A --coverage=cov_profile tests | |
- name: generate coverage report | |
run: deno coverage cov_profile --exclude=src/ > coverage_report.txt | |
# Remove ANSI escape codes from the coverage report using sed | |
- name: Clean coverage report | |
run: | | |
sed 's/\x1b\[[0-9;]*m//g' coverage_report.txt > cleaned_coverage_report.txt | |
# Save the cleaned report to an environment variable | |
- name: Save cleaned coverage report to ENV | |
id: coverage | |
run: | | |
echo "CLEANED_COVERAGE_REPORT<<EOF" >> $GITHUB_ENV | |
cat cleaned_coverage_report.txt >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
# Post the cleaned coverage report as a PR comment | |
- name: Comment on PR | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
recreate: true | |
header: Coverage Report | |
message: | | |
```plaintext | |
${{ env.CLEANED_COVERAGE_REPORT }} | |
``` |