docs: switch branch from "master" to "main" #70
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: build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
name: Ubuntu NodeJS v${{ matrix.node-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
node-version: [18, 20] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add codecov | |
- run: yarn install | |
- run: yarn run lint | |
- run: yarn run build | |
- run: yarn test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
slack: | |
name: Slack Notification | |
needs: build | |
runs-on: ubuntu-22.04 | |
if: always() | |
steps: | |
- uses: 8398a7/action-slack@v3 | |
with: | |
status: custom | |
fields: all | |
custom_payload: | | |
{ | |
attachments: [{ | |
color: '${{ needs.build.result }}' === 'success' ? 'good' : '${{ needs.build.result }}' === 'failure' ? 'danger' : 'warning', | |
text: `*${process.env.AS_REPO}* | ${process.env.AS_REF} | *${process.env.AS_EVENT_NAME}*\n${process.env.AS_COMMIT} | ${process.env.AS_MESSAGE}\n*${{ needs.build.result }}* | ${process.env.AS_WORKFLOW}`, | |
}] | |
} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: always() |