Skip to content

Instantly share code, notes, and snippets.

@crisu83
Last active April 8, 2021 08:15
Show Gist options
  • Select an option

  • Save crisu83/3405cc58bdcae389b953ce05e08161f2 to your computer and use it in GitHub Desktop.

Select an option

Save crisu83/3405cc58bdcae389b953ce05e08161f2 to your computer and use it in GitHub Desktop.
CI workflow for GitHub Actions. Paste the contents in .github/workflows/ci.yml to enable it for your repository.
name: CI
on: [push]
jobs:
schema:
name: Schema
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Inspect Schema
uses: kamilkisiela/graphql-inspector@master
with:
schema: 'master:schema.graphql'
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: yarn install
- name: Lint code
run: yarn lint
test-and-analyze:
name: Test and Analyze
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # Disable shallow clone for SonarCloud
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: yarn install
- name: Generate GraphQL types
run: yarn codegen
- name: Run tests
run: yarn test --coverage
- name: Analyze code
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment