Pin dependencies #510
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 will perform the code review on each code change. | |
# It uses "actions/cache" and turborepo in order to perform tasks only on changed files. | |
name: "Continuous Integration" | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- apps/** | |
- packages/** | |
- package.json | |
- turbo.json | |
- .github/workflows/code_review.yaml | |
- docker/**/* | |
pull_request: | |
types: [opened, edited, synchronize, reopened, ready_for_review] | |
paths: | |
- apps/** | |
- packages/** | |
- package.json | |
- turbo.json | |
- .github/workflows/code_review.yaml | |
- docker/**/* | |
workflow_dispatch: | |
jobs: | |
code_review: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 | |
with: | |
node-version-file: ".node-version" | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Cache turbo build setup | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1 | |
with: | |
path: node_modules/.cache/turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
- name: Build | |
run: yarn build | |
- name: "Code review" | |
run: yarn code-review | |
# this step uses a set of filters to prevent | |
# additional work not needed | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
id: sonarcloud_filter | |
with: | |
filters: ./.github/ci_filters.yaml | |
- name: SonarCloud session-manager scan | |
if: steps.sonarcloud_filter.outputs.io-session-manager == 'true' | |
uses: SonarSource/sonarcloud-github-action@19888635fa64d24e533d388efe8264402dfd721b | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
projectBaseDir: apps/io-session-manager/ | |
- name: SonarCloud io-fast-login scan | |
if: steps.sonarcloud_filter.outputs.io-fast-login == 'true' | |
uses: SonarSource/sonarcloud-github-action@19888635fa64d24e533d388efe8264402dfd721b | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
projectBaseDir: apps/io-fast-login/ | |
- name: SonarCloud io-lollipop scan | |
if: steps.sonarcloud_filter.outputs.io-lollipop == 'true' | |
uses: SonarSource/sonarcloud-github-action@19888635fa64d24e533d388efe8264402dfd721b | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
projectBaseDir: apps/io-lollipop/ | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 | |
with: | |
node-version-file: ".node-version" | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Cache turbo build setup | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1 | |
with: | |
path: node_modules/.cache/turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
- name: Build | |
run: yarn build | |
- name: Generate Environment | |
run: yarn docker:generate:env | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
id: test_filter | |
with: | |
filters: ./.github/ci_filters.yaml | |
- name: "io-lollipop integration Tests" | |
if: steps.test_filter.outputs.io-lollipop == 'true' | |
run: >- | |
yarn docker:start:build io-lollipop && | |
yarn test:integrations:io-lollipop | |
- name: "E2E Tests" | |
if: steps.test_filter.outputs.io-session-manager == 'true' | |
run: yarn workspace e2e start |