Add data pr workflow; download new data programmatically from gcs #356
Workflow file for this run
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: Python application | |
on: [pull_request] | |
jobs: | |
build: | |
name: tests-pass | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
pull-requests: 'write' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Test with pytest | |
run: | | |
mkdir coverage | |
coverage run -m pytest tests | |
coverage xml -o coverage/python.xml | |
- name: Report python coverage | |
uses: orgoro/coverage@v3 | |
with: | |
coverageFile: coverage/python.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Authenticate to Google Cloud' | |
id: 'auth' | |
uses: 'google-github-actions/auth@v0' | |
with: | |
workload_identity_provider: 'projects/855475113448/locations/global/workloadIdentityPools/eto-github/providers/eto-github' | |
service_account: 'eto-artifact-registry-github@gcp-cset-projects.iam.gserviceaccount.com' | |
token_format: 'access_token' | |
- name: 'Log into Artifact Registry' | |
uses: 'docker/login-action@v1' | |
with: | |
registry: us-east1-docker.pkg.dev | |
username: 'oauth2accesstoken' | |
password: '${{ steps.auth.outputs.access_token }}' | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Test with jest | |
shell: bash | |
run: | | |
cd github-metrics | |
npm run artifactregistry-login | |
npm install | |
npm test -- --coverage --coverageReporters="json-summary" --coverageReporters="text" | tee ./coverage.txt | |
- name: Report javascript coverage | |
uses: MishaKav/[email protected] | |
with: | |
title: "JavaScript Coverage" | |
summary-title: "Summary" | |
coverage-title: "Modified Files" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
report-only-changed-files: true | |
coverage-path: ./github-metrics/coverage.txt | |
coverage-summary-path: ./github-metrics/coverage/coverage-summary.json | |
coverage-path-prefix: github-metrics/src/ | |
- name: Run linting | |
run: | | |
pre-commit run --all-files |