Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

added a script to install packages depending on OS #65

Merged
merged 12 commits into from
Feb 26, 2021
47 changes: 30 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
node-version: [12.x]
platform: [ubuntu-latest] #[ubuntu-latest, windows-latest, macos-latest]
platform: [ubuntu-latest, windows-latest, macos-latest]
# Build OS
runs-on: ${{ matrix.platform }}
# CI
Expand All @@ -25,32 +25,45 @@ jobs:
run: npm i
# create a config file
- name: Create Config File
uses: "finnp/create-file-action@master"
env:
FILE_NAME: "config.json"
FILE_DATA: '{"BITLY_TOKEN": "${{ secrets.BITLY_TOKEN }}","TWITCH_TOKEN": "${{ secrets.TWITCH_TOKEN }}","DISCORD_TOKEN": "${{ secrets.DISCORD_TOKEN }}"}'
uses: "DamianReeves/[email protected]"
with:
path: ./config.json
contents: '{"BITLY_TOKEN": "${{ secrets.BITLY_TOKEN }}","TWITCH_TOKEN": "${{ secrets.TWITCH_TOKEN }}","DISCORD_TOKEN": "${{ secrets.DISCORD_TOKEN }}"}'
write-mode: overwrite
# run tests
- name: Run tests
run: npm run test:ci
# conditions with test fails or succeeds
- name: Tests ✅
shell: bash
if: ${{ success() }}
run: |
curl --request POST --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --header 'content-type: application/json' --data '{
"context": "tests",
"state": "success",
"description": "Tests passed",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'
curl \
-X POST \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
-d '{
"context": "tests",
"state": "success",
"description": "Tests passed",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }}
- name: Tests 🚨
if: ${{ failure() }}
shell: bash
run: |
curl --request POST --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --header 'content-type: application/json' --data '{
"context": "tests",
"state": "failure",
"description": "Tests failed",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'
curl \
-X POST \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
-d '{
"context": "tests",
"state": "failure",
"description": "Tests failed",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }}
# Code Coverage
- name: Code Coverage
uses: codecov/codecov-action@v1
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
"author": "",
"license": "ISC",
"resolutions": {
"**/**/fsevents": "^1.2.9"
},
"dependencies": {
"@discordjs/opus": "^0.3.3",
"axios": ">=0.21.1",
Expand Down