fixes #85
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: Test | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-24.04] | |
node-version: [20.x] | |
mongodb-version: ['7.0'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Start MongoDB | |
uses: supercharge/mongodb-github-action@1.10.0 | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
mongodb-username: ssp-relay-user | |
mongodb-password: ssp-relay-password | |
mongodb-db: ssp-relay | |
- name: npm install | |
run: npm i | |
- name: Setup CI config | |
run: | | |
echo $SERVICE_ACCOUNT_CONFIG > config/serviceAccountKey.json | |
echo $API_SECRETS > config/apisecrets.ts | |
echo $ALCHEMY_SECRETS > config/alchemysecrets.ts | |
touch logs/debug.log logs/error.log logs/info.log | |
shell: bash | |
env: | |
SERVICE_ACCOUNT_CONFIG: ${{ secrets.SERVICE_ACCOUNT_CI }} | |
API_SECRETS: ${{ secrets.API_SECRETS }} | |
ALCHEMY_SECRETS: ${{ secrets.ALCHEMY_SECRETS }} | |
- name: Run tests and collect coverage | |
run: | | |
npm run test | |
env: | |
CI: true | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
verbose: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |