gcp implementation added; #14
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 Job | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Test Application | |
run: echo "Testing the application" | |
final_job: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Dependencies | |
run: npm install @google-cloud/logging | |
- name: Set Google Application Credentials | |
# Store the GCP Service Account key in GitHub secrets (to be retrieved here) | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | |
run: | | |
echo "$GOOGLE_APPLICATION_CREDENTIALS" > /tmp/credentials.json | |
export GOOGLE_APPLICATION_CREDENTIALS=/tmp/credentials.json | |
- name: Final Job | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Determining which workflow triggered the Final Job..." | |
node source/dump-ci-stats-to-gcp-logs.js "Test Job" |