diff --git a/.github/workflows/quality-checks.yaml b/.github/workflows/checks.quality.yaml similarity index 96% rename from .github/workflows/quality-checks.yaml rename to .github/workflows/checks.quality.yaml index a9d564e2..60f66923 100644 --- a/.github/workflows/quality-checks.yaml +++ b/.github/workflows/checks.quality.yaml @@ -1,4 +1,4 @@ -name: Quality checks +name: quality-checks on: [ push, pull_request ] diff --git a/.github/workflows/security-checks.yaml b/.github/workflows/checks.security.yaml similarity index 96% rename from .github/workflows/security-checks.yaml rename to .github/workflows/checks.security.yaml index 97330bb1..9138edc2 100644 --- a/.github/workflows/security-checks.yaml +++ b/.github/workflows/checks.security.yaml @@ -1,4 +1,4 @@ -name: Security checks +name: security-checks on: push: diff --git a/.github/workflows/deploy-desktop.yaml b/.github/workflows/release.desktop.yaml similarity index 98% rename from .github/workflows/deploy-desktop.yaml rename to .github/workflows/release.desktop.yaml index 2d74b617..341385e6 100644 --- a/.github/workflows/deploy-desktop.yaml +++ b/.github/workflows/release.desktop.yaml @@ -1,4 +1,4 @@ -name: Deploy desktop +name: desktop-release on: release: diff --git a/.github/workflows/bump-and-release.yaml b/.github/workflows/release.git.yaml similarity index 97% rename from .github/workflows/bump-and-release.yaml rename to .github/workflows/release.git.yaml index 0d55e399..bf87db50 100644 --- a/.github/workflows/bump-and-release.yaml +++ b/.github/workflows/release.git.yaml @@ -1,4 +1,4 @@ -name: Bump & release +name: git-release on: push: # Ensure a new release is created for each new tag diff --git a/.github/workflows/deploy-site.yaml b/.github/workflows/release.site.yaml similarity index 99% rename from .github/workflows/deploy-site.yaml rename to .github/workflows/release.site.yaml index 18727358..95172c7b 100644 --- a/.github/workflows/deploy-site.yaml +++ b/.github/workflows/release.site.yaml @@ -1,4 +1,4 @@ -name: Deploy site +name: site-release on: release: diff --git a/.github/workflows/tests.e2e.yaml b/.github/workflows/tests.e2e.yaml new file mode 100644 index 00000000..58d948ad --- /dev/null +++ b/.github/workflows/tests.e2e.yaml @@ -0,0 +1,28 @@ +name: e2e-tests + +on: + push: + pull_request: + +jobs: + run-tests: + strategy: + matrix: + os: [macos, ubuntu, windows] + fail-fast: false # So it still runs on other OSes if one of them fails + runs-on: ${{ matrix.os }}-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Setup node + uses: actions/setup-node@v1 + with: + node-version: 15.x + - + name: Install dependencies + run: npm ci + - + name: Run e2e tests + run: npm run test:e2e -- --headless diff --git a/.github/workflows/test.yaml b/.github/workflows/tests.integration.yaml similarity index 71% rename from .github/workflows/test.yaml rename to .github/workflows/tests.integration.yaml index f1538b08..805ace07 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/tests.integration.yaml @@ -1,9 +1,9 @@ -name: Test +name: integration-tests on: push: pull_request: - schedule: # for integration tests + schedule: # To get notified about problems from third party dependencies - cron: '0 0 * * 0' # at 00:00 on every Sunday jobs: @@ -25,13 +25,6 @@ jobs: - name: Install dependencies run: npm ci - - - name: Run unit tests - run: npm run test:unit - name: Run integration tests run: npm run test:integration - - - name: Run e2e tests - if: always() # Run even if previous step fail - run: npm run test:e2e -- --headless diff --git a/.github/workflows/tests.unit.yaml b/.github/workflows/tests.unit.yaml new file mode 100644 index 00000000..bc6047df --- /dev/null +++ b/.github/workflows/tests.unit.yaml @@ -0,0 +1,28 @@ +name: unit-tests + +on: + push: + pull_request: + +jobs: + run-tests: + strategy: + matrix: + os: [macos, ubuntu, windows] + fail-fast: false # So it still runs on other OSes if one of them fails + runs-on: ${{ matrix.os }}-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Setup node + uses: actions/setup-node@v1 + with: + node-version: 15.x + - + name: Install dependencies + run: npm ci + - + name: Run units + run: npm run test:unit diff --git a/README.md b/README.md index 373bcee8..990099a2 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,92 @@ > Enforce privacy & security best-practices on Windows and macOS, because privacy is sexy 🍑🍆 -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](./CONTRIBUTING.md) -[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/undergroundwires/privacy.sexy.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/undergroundwires/privacy.sexy/context:javascript) -[![Maintainability](https://api.codeclimate.com/v1/badges/3a70b7ef602e2264342c/maintainability)](https://codeclimate.com/github/undergroundwires/privacy.sexy/maintainability) -[![Tests status](https://github.com/undergroundwires/privacy.sexy/workflows/Test/badge.svg)](https://github.com/undergroundwires/privacy.sexy/actions) -[![Quality checks status](https://github.com/undergroundwires/privacy.sexy/workflows/Quality%20checks/badge.svg)](https://github.com/undergroundwires/privacy.sexy/actions) -[![Security checks status](https://github.com/undergroundwires/privacy.sexy/workflows/Security%20checks/badge.svg)](https://github.com/undergroundwires/privacy.sexy/actions) -[![Bump & release status](https://github.com/undergroundwires/privacy.sexy/workflows/Bump%20&%20release/badge.svg)](https://github.com/undergroundwires/privacy.sexy/actions) -[![Deploy status](https://github.com/undergroundwires/privacy.sexy/workflows/Build%20&%20deploy/badge.svg)](https://github.com/undergroundwires/privacy.sexy/actions) -[![Auto-versioned by bump-everywhere](https://github.com/undergroundwires/bump-everywhere/blob/master/badge.svg?raw=true)](https://github.com/undergroundwires/bump-everywhere) + +

+ + contributions are welcome + + +
+ + Language grade: JavaScript/TypeScript + + + Maintainability + + +
+ + Unit tests status + + + Integration tests status + + + E2E tests status + + +
+ + Quality checks status + + + Security checks status + + +
+ + Git release status + + + Site release status + + + Desktop application release status + + +
+ + Auto-versioned by bump-everywhere + +

+ ## Get started @@ -87,5 +164,6 @@ - CI/CD is fully automated for this repo using different GIT events & GitHub actions. - Versioning, tagging, creation of `CHANGELOG.md` and releasing is automated using [bump-everywhere](https://github.com/undergroundwires/bump-everywhere) action - Everything that's merged in the master goes directly to production. +- 📖 Read more on [CI/CD pipelines](./docs/ci-cd.md) [![CI/CD to AWS with GitHub Actions](img/architecture/gitops.png)](.github/workflows/) diff --git a/docs/ci-cd.md b/docs/ci-cd.md new file mode 100644 index 00000000..0c92c31b --- /dev/null +++ b/docs/ci-cd.md @@ -0,0 +1,19 @@ +# Pipelines + +Pipelines are found under [`.github/workflows`](./../.github/workflows). + +## Pipeline types + +They are categorized based on their type: + +- `tests`: Different types of tests to verify functionality. +- `checks`: Other controls such as vulnerability scans or styling checks. +- `release`: Pipelines used for release of deployment such as building and testing. + +## Naming conventions + +Pipeline files are named using: **`..yaml`**. + +**`type`**: Sub-folders do not work for GitHub workflows so that's why `.` prefix is used. See also [pipeline types](#pipeline-types). + +**`name`**: Pipeline themselves are named using kebab case. It allows for easier URL references for their status badges. E.g. file name `tests.unit.yaml`, pipeline name: `name: unit-tests`