chore: the argument --apply
is deprecated
#3
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 and Test | |
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: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install Codecov | |
run: yarn global add codecov | |
- name: Install dependencies | |
run: yarn install | |
- name: Lint | |
run: yarn run lint | |
- name: Build | |
run: yarn run build | |
- name: Test | |
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: | |
- name: Send notification message | |
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() |