Updated github CI/CD tests #442
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 and upload coverage | |
on: ["push", "pull_request"] | |
jobs: | |
test-api-python: | |
name: Coverage | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.10, 3.11, 3.12] | |
mongodb-version: ["3.6"] | |
steps: | |
# Check out Scout code | |
- uses: actions/checkout@v4 | |
# Set up python | |
- name: Set up Python ${{ matrix.python-version}} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version}} | |
- name: Production Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ./api[test] | |
- name: Test API with pytest & coveralls | |
run: | | |
pytest --cov ./api | |
coveralls | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
test-js: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [17.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install node packages | |
working-directory: ./api | |
run: npm ci | |
- name: Build packages | |
working-directory: ./api | |
run: npm run build --if-present | |
- name: Run tests | |
working-directory: ./api | |
run: npm run test |