This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
chore(deps): bump @babel/traverse and @graphql-tools/graphql-tag-pluck #277
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
name: Test and release | |
# Run the workflow when a Pull Request is opened or when changes are pushed to master | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
sonarcloud: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Run the steps below with the following versions of Node.js | |
node-version: [14.x] | |
env: | |
DATABASE_URL: 'mysql://root:root@localhost:3306/test' | |
steps: | |
# Start pre-installed Ubuntu mysql service | |
- name: Start MySQL | |
run: sudo /etc/init.d/mysql start | |
# Create test DB for e2e tests | |
- name: Create test DB | |
run: mysql -e 'CREATE DATABASE test;' --user=root --password=root | |
# Fetch the latest commit | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Setup Node.js using the appropriate version | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# Install package dependencies | |
- name: Install | |
run: npm ci | |
# Run migrations | |
- name: Migrate | |
run: npm run migrate | |
# Run tests | |
- name: Test | |
run: npm test | |
release: | |
# Only release on push to main | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
# Waits for test jobs for each Node.js version to complete | |
needs: [test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.x | |
- name: Install | |
run: npm ci | |
- name: Release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |