wip: migration from travis ci to github actions #1 #33
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: Run Tests | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ vars.NODE_VERSION }} | |
- name: Install dependencies | |
run: yarn | |
- name: Run tests | |
run: | | |
yarn test | |
env: | |
TOKEN_GITHUB: ${{ vars.TOKEN_GITHUB }} | |
CC_TEST_REPORTER_ID: 8e87a996279373f05f01ce8166aac1bc9dda990e9a2f936af25e5aa11326b127 | |
notify_slack: | |
runs-on: ubuntu-latest | |
needs: test | |
if: always() | |
steps: | |
- name: Notify on Slack | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ vars.SLACK_WEBHOOK }} | |
SLACK_CHANNEL: libs | |
SLACK_USERNAME: GitHub Actions | |
SLACK_ICON: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png | |
SLACK_COLOR: ${{ job.status == 'success' && 'good' || 'danger' }} | |
SLACK_MESSAGE: Build of ${{ github.repository }}@${{ github.ref_name }} by ${{ github.actor }} ${{ job.status == 'success' && 'passed' || 'failed' }} | |
SLACK_FOOTER: | |
coverage: | |
needs: [ test ] | |
name: coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ vars.NODE_VERSION }} | |
- run: npm install -g yarn | |
- run: yarn | |
- uses: paambaati/codeclimate-action@v5.0.0 | |
env: | |
CC_TEST_REPORTER_ID: 8e87a996279373f05f01ce8166aac1bc9dda990e9a2f936af25e5aa11326b127 | |
TOKEN_GITHUB: ${{ vars.TOKEN_GITHUB }} | |
with: | |
coverageCommand: yarn test | |
debug: true |