Skip to content

Commit

Permalink
feat: add integration test to CI (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon authored Apr 20, 2021
1 parent ef45931 commit 6af29ac
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 29 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,41 @@ on:
branches: [master]

jobs:
check-build-test:
build-test:
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
- name: Checkout sources
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Get yarn cache directory path
- name: Cache prep
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 'Install dependencies'
- name: Install dependencies
run: yarn install

- name: 'Build sgd'
- name: Build plugin
run: yarn pack

- name: 'Test coverage'
- name: Unit test
run: yarn test:coverage

- name: Upload coverage to Codecov
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
42 changes: 27 additions & 15 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,70 @@ on:
branches: [master]

jobs:
check-build-test:
build-test:
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
- name: Checkout sources
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Get yarn cache directory path
- name: Cache prep
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 'Install dependencies'
- name: Install dependencies
run: yarn install

- name: 'Build sgd'
run: yarn pack

- name: 'Linting'
- name: Lint sources
run: yarn lint
continue-on-error: true

- name: Build plugin
run: yarn pack

- name: 'Test coverage'
- name: Unit test
run: yarn test:coverage

- name: Upload coverage to Codecov
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true

commitlint:
- name: Install plugin
run: |
npm install -g sfdx-cli
sfdx plugins:link .
- name: Integration test
run: sfdx sgd:source:delta --help

commit-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint commits
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2

prlint:
pr-lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v1.2.0
- name: Lint PR
uses: amannn/action-semantic-pull-request@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 22 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,35 @@ on:
types: [published]

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Checkout sources
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14.x
registry-url: https://registry.npmjs.org/
- name: 'Install dependencies'

- name: Cache prep
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: 'Publish to npm'
- name: Publish to npm
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 6af29ac

Please sign in to comment.