Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vladbabayan05 committed Nov 11, 2024
1 parent d6a60a7 commit 4f622e2
Showing 1 changed file with 130 additions and 126 deletions.
256 changes: 130 additions & 126 deletions .github/workflows/test-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ permissions:
pull-requests: write


#on:
# push:
# branches:
# - 'main'
# - 'v3'
# - 'release/**'
on:
push:
branches:
- update_creds
# pull_request:
# types:
# - opened
Expand All @@ -26,127 +24,133 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}

jobs:
setup:
runs-on: ubuntu-latest
if: github.event_name == 'push' || (! github.event.pull_request.draft)
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
steps:
- name: Setup tests matrix
id: setup
shell: python
run: |
import os
import json
matrix = {
"os": [
"ubuntu-latest",
"windows-latest",
],
"python-version": [
"3.11",
],
"storage": [
"--hub-cloud --local",
"--s3 --gcs --azure --gdrive --memory-skip"
]
}
if "${{ github.event_name }}" == "pull_request":
if "${{ contains(github.event.pull_request.labels.*.name, 'quick-tests') }}" == "true":
matrix = {
"os": [
"ubuntu-latest",
],
"python-version": [
"3.11",
],
"storage": [
"local",
]
}
if "${{ contains(github.event.pull_request.labels.*.name, 'macos-tests') }}" == "true":
matrix["os"].append("macos-latest")
# setup:
# runs-on: ubuntu-latest
# if: github.event_name == 'push' || (! github.event.pull_request.draft)
# outputs:
# matrix: ${{ steps.setup.outputs.matrix }}
# steps:
# - name: Setup tests matrix
# id: setup
# shell: python
# run: |
# import os
# import json

# matrix = {
# "os": [
# "ubuntu-latest",
# "windows-latest",
# ],
# "python-version": [
# "3.11",
# ],
# "storage": [
# "--hub-cloud --local",
# "--s3 --gcs --azure --gdrive --memory-skip"
# ]
# }

# if "${{ github.event_name }}" == "pull_request":
# if "${{ contains(github.event.pull_request.labels.*.name, 'quick-tests') }}" == "true":
# matrix = {
# "os": [
# "ubuntu-latest",
# ],
# "python-version": [
# "3.11",
# ],
# "storage": [
# "local",
# ]
# }

# if "${{ contains(github.event.pull_request.labels.*.name, 'macos-tests') }}" == "true":
# matrix["os"].append("macos-latest")

# if "${{ contains(github.event.pull_request.labels.*.name, 'full-tests') }}" == "true":
# matrix["os"] = [
# "macos-latest",
# "ubuntu-latest",
# "windows-latest",
# ]
# matrix["python-version"] = [
# "3.11",
# "3.10",
# "3.9",
# "3.8",
# ]
# matrix["storage"] = [
# "--hub-cloud --local",
# "--s3 --gcs --azure --gdrive --memory-skip"
# ]

if "${{ contains(github.event.pull_request.labels.*.name, 'full-tests') }}" == "true":
matrix["os"] = [
"macos-latest",
"ubuntu-latest",
"windows-latest",
]
matrix["python-version"] = [
"3.11",
"3.10",
"3.9",
"3.8",
]
matrix["storage"] = [
"--hub-cloud --local",
"--s3 --gcs --azure --gdrive --memory-skip"
]
elif "${{ github.event_name }}" == "push":
if "${{ github.ref_name == 'main' || github.ref_name == 'v3' || startsWith( github.ref_name, 'release/' ) }}" == "true":
matrix["os"] = [
"macos-latest",
"ubuntu-latest",
"windows-latest",
]
matrix["python-version"] = [
"3.11",
"3.10",
"3.9",
"3.8",
]
else:
raise Exception("Unexpected branch")
else:
raise Exception("Unexpected event")
matrix["exclude"] = [
{
"os": "macos-latest",
"python-version": "3.8",
},
{
"os": "macos-latest",
"python-version": "3.9",
},
{
"os": "macos-latest",
"python-version": "3.11",
},
{
"os": "windows-latest",
"python-version": "3.11",
},
]
with open(os.environ.get("GITHUB_OUTPUT"), "a") as file:
file.write("matrix=%s\n" % json.dumps(matrix))
# elif "${{ github.event_name }}" == "push":
# if "${{ github.ref_name == 'main' || github.ref_name == 'v3' || startsWith( github.ref_name, 'release/' ) }}" == "true":
# matrix["os"] = [
# "macos-latest",
# "ubuntu-latest",
# "windows-latest",
# ]
# matrix["python-version"] = [
# "3.11",
# "3.10",
# "3.9",
# "3.8",
# ]
# else:
# raise Exception("Unexpected branch")
# else:
# raise Exception("Unexpected event")

# matrix["exclude"] = [
# {
# "os": "macos-latest",
# "python-version": "3.8",
# },
# {
# "os": "macos-latest",
# "python-version": "3.9",
# },
# {
# "os": "macos-latest",
# "python-version": "3.11",
# },
# {
# "os": "windows-latest",
# "python-version": "3.11",
# },
# ]

# with open(os.environ.get("GITHUB_OUTPUT"), "a") as file:
# file.write("matrix=%s\n" % json.dumps(matrix))

test:
name: Test
needs: setup
uses: activeloopai/shared-github-actions/.github/workflows/full_test.yml@main
if: github.repository == 'activeloopai/deeplake'
with:
repo: ${{ github.repository }}
ref: ${{ github.sha }}
testMatrix: ${{ needs.setup.outputs.matrix }}
# name: Test
# needs: setup
# uses: activeloopai/shared-github-actions/.github/workflows/full_test.yml@main
# if: github.repository == 'activeloopai/deeplake'
# with:
# repo: ${{ github.repository }}
# ref: ${{ github.sha }}
# testMatrix: ${{ needs.setup.outputs.matrix }}

runs-on: ubuntu-latest
steps:
- name: Debugging with tmate
uses: mxschmitt/[email protected]
with:

secrets:
token: ${{ secrets.GITHUB_TOKEN }}
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
gcp_sa_credentials_json: ${{ secrets.GCP_SA_CREDENTIALS_JSON }}
azure_creds_json: ${{ secrets.AZURE_CREDS_JSON }}
hub_username: ${{ secrets.ACTIVELOOP_HUB_USERNAME }}
hub_token: ${{ secrets.ACTIVELOOP_HUB_TOKEN }}
kaggle_username: ${{ secrets.KAGGLE_USERNAME }}
kaggle_key: ${{ secrets.KAGGLE_KEY }}
oauth_client_id: ${{ secrets.GDRIVE_CLIENT_ID }}
oauth_client_secret: ${{ secrets.GDRIVE_CLIENT_SECRET }}
oauth_refresh_token: ${{ secrets.GDRIVE_REFRESH_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
# secrets:
# token: ${{ secrets.GITHUB_TOKEN }}
# aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
# gcp_sa_credentials_json: ${{ secrets.GCP_SA_CREDENTIALS_JSON }}
azure_creds_json: ${{ secrets.AZURE_CREDS_JSON }}
# hub_username: ${{ secrets.ACTIVELOOP_HUB_USERNAME }}
# hub_token: ${{ secrets.ACTIVELOOP_HUB_TOKEN }}
# kaggle_username: ${{ secrets.KAGGLE_USERNAME }}
# kaggle_key: ${{ secrets.KAGGLE_KEY }}
# oauth_client_id: ${{ secrets.GDRIVE_CLIENT_ID }}
# oauth_client_secret: ${{ secrets.GDRIVE_CLIENT_SECRET }}
# oauth_refresh_token: ${{ secrets.GDRIVE_REFRESH_TOKEN }}
# sonar_token: ${{ secrets.SONAR_TOKEN }}

0 comments on commit 4f622e2

Please sign in to comment.