Skip to content

Commit

Permalink
Merge branch 'master' into ner-model
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed Jun 25, 2024
2 parents b84aeeb + 80077bf commit 7ab722b
Show file tree
Hide file tree
Showing 203 changed files with 20,089 additions and 4,626 deletions.
96 changes: 38 additions & 58 deletions .github/workflows/continuous.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,41 @@
name: Continuous
on:
push:
pull_request:
merge_group:
push:
branches:
- master

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
duplication-check:
runs-on: ubuntu-latest
outputs:
inPR: ${{ steps.check.outputs.number != '' }}
steps:
- name: Check if push is in PR
id: check
uses: 8BitJonny/[email protected]
with:
filterOutClosed: true
github-token: ${{ secrets.GITHUB_TOKEN }}
build-generic:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
name: "Continuous Image Build"
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
needs: duplication-check
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'push' && needs.duplication-check.outputs.inPR == 'false' ) }}
strategy:
matrix:
app: [ web, node ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: 'projects/${{ secrets.DEV_GKE_PROJECT_ID}}/locations/global/workloadIdentityPools/github/providers/github'
service_account: '${{ secrets.DEV_GKE_SA }}'
- name: Login to GCR
uses: docker/login-action@v1
with:
registry: gcr.io
username: oauth2accesstoken
password: '${{ steps.auth.outputs.access_token }}'
- name: Login to GAR
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: us-east1-docker.pkg.dev
username: oauth2accesstoken
Expand All @@ -73,7 +59,6 @@ jobs:
uses: docker/metadata-action@v3
with:
images: |
gcr.io/${{ secrets.DEV_PROJECT }}/sefaria-${{ matrix.app }}-${{ steps.branch-name.outputs.current_branch }}
us-east1-docker.pkg.dev/${{ secrets.DEV_PROJECT }}/containers/sefaria-${{ matrix.app }}-${{ steps.branch-name.outputs.current_branch }}
# generate Docker tags based on the following events/attributes
tags: |
Expand All @@ -95,38 +80,32 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-derived:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
name: "Continuous Image Build Stage 2"
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
needs:
- duplication-check
- build-generic
strategy:
matrix:
app: [ asset, linker ]
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'push' && needs.duplication-check.outputs.inPR == 'false' ) }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: 'projects/${{ secrets.DEV_GKE_PROJECT_ID}}/locations/global/workloadIdentityPools/github/providers/github'
service_account: '${{ secrets.DEV_GKE_SA }}'
- name: Login to GCR
uses: docker/login-action@v1
with:
registry: gcr.io
username: oauth2accesstoken
password: '${{ steps.auth.outputs.access_token }}'
- name: Login to GAR
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: us-east1-docker.pkg.dev
username: oauth2accesstoken
Expand All @@ -150,7 +129,6 @@ jobs:
uses: docker/metadata-action@v3
with:
images: |
gcr.io/${{ secrets.DEV_PROJECT }}/sefaria-${{ matrix.app }}-${{ steps.branch-name.outputs.current_branch }}
us-east1-docker.pkg.dev/${{ secrets.DEV_PROJECT }}/containers/sefaria-${{ matrix.app }}-${{ steps.branch-name.outputs.current_branch }}
# generate Docker tags based on the following events/attributes
tags: |
Expand All @@ -175,15 +153,15 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
#######
# Below Tests only run on PR
# Below Tests only run if PR is NOT draft
#######
jest-tests:
name: "Jest" # This name is referenced when slacking status
name: "Continuous Testing: Jest" # This name is referenced when slacking status
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
if: github.event.pull_request.draft == false
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies
run: |
npm install
Expand All @@ -196,21 +174,22 @@ jobs:
run: cat /home/runner/jestResults.json; STATUS=`jq ".numFailedTestSuites" /home/runner/jestResults.json`; exit $STATUS
if: ${{ always() }}
sandbox-deploy:
name: "Continuous Testing: Sandbox Deploy"
concurrency:
group: dev-mongo
cancel-in-progress: false
if: ${{ github.event_name == 'pull_request' }}
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: build-derived
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: 'projects/${{ secrets.DEV_GKE_PROJECT_ID}}/locations/global/workloadIdentityPools/github/providers/github'
Expand Down Expand Up @@ -252,7 +231,7 @@ jobs:
PROJECT_ID: "${{ secrets.DEV_PROJECT }}"
NAMESPACE: "${{secrets.DEV_SANDBOX_NAMESPACE}}"
sandbox-ready:
if: ${{ github.event_name == 'pull_request' }}
if: github.event.pull_request.draft == false
needs: sandbox-deploy
runs-on: ubuntu-latest
steps:
Expand All @@ -268,11 +247,11 @@ jobs:
WAIT_DURATION: "3000"
GIT_COMMIT: "${{ steps.get-sha.outputs.sha_short }}"
pytest-job:
name: "Continuous Testing: PyTest"
concurrency:
group: dev-mongo
cancel-in-progress: false
if: ${{ github.event_name == 'pull_request' }}
name: "PyTest" # This name is referenced when slacking status
if: github.event.pull_request.draft == false
needs:
- sandbox-ready
permissions:
Expand All @@ -281,10 +260,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: 'projects/${{ secrets.DEV_GKE_PROJECT_ID}}/locations/global/workloadIdentityPools/github/providers/github'
Expand Down Expand Up @@ -331,12 +310,13 @@ jobs:
run: kubectl delete jobs -l ci-run=$GITHUB_RUN_ID,test-name=pytest
if: always()
ending-notification:
name: "Continuous Testing: Notifications"
runs-on: ubuntu-latest
if: ${{ always() && github.event_name == 'pull_request' }}
if: ${{ always() && (github.event.pull_request.draft == false) }}
needs:
- pytest-job
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v2
with:
node-version: '14'
Expand All @@ -350,8 +330,8 @@ jobs:
GITUSER_SLACK_MAP: ${{secrets.GITUSER_SLACK_MAP}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
sandbox-cleanup:
name: "Clean up CI Sandbox"
if: ${{ always() && github.event_name == 'pull_request' }}
name: "Continuous Testing: Clean up"
if: ${{ always() && (github.event.pull_request.draft == false) }}
needs:
- pytest-job
runs-on: ubuntu-latest
Expand All @@ -360,10 +340,10 @@ jobs:
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: 'projects/${{ secrets.DEV_GKE_PROJECT_ID}}/locations/global/workloadIdentityPools/github/providers/github'
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ jobs:
id: semantic
with:
working_directory: ./helm-chart
semantic_version: 18.0.1
extra_plugins: |
[email protected]
@semantic-release/[email protected]
[email protected]
@semantic-release/[email protected]
extends: |
semantic-release-monorepo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup
Expand Down
Loading

0 comments on commit 7ab722b

Please sign in to comment.