Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork test #1342

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 56 additions & 51 deletions .github/workflows/test_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,55 +74,60 @@ jobs:
github.event.client_payload.slash_command.args.named.sha
)
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Test
run: |
python -m pip install --upgrade pip hatch
python -m hatch env create integration
- name: Run integration tests
env:
TERM: unknown
SNOWFLAKE_CONNECTIONS_INTEGRATION_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_CONNECTIONS_INTEGRATION_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_CONNECTIONS_INTEGRATION_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
run: python -m hatch run integration:test
# Update check run called "integration-fork"
- uses: actions/github-script@v7
id: update-check-run
if: ${{ always() }}
env:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pull } = await github.rest.pulls.get({
...context.repo,
pull_number: process.env.number
});
const ref = pull.head.sha;

const { data: checks } = await github.rest.checks.listForRef({
...context.repo,
ref
});

const check = checks.check_runs.filter(c => c.name === process.env.job);

const { data: result } = await github.rest.checks.update({
...context.repo,
check_run_id: check[0].id,
status: 'completed',
conclusion: process.env.conclusion
});

return result;
echo ${{ github.event_name }}
echo ${{ github.event.client_payload.slash_command.args.named.sha }}
echo ${{ github.event.client_payload.pull_request.head.sha }}
# - uses: actions/checkout@v4
# with:
# persist-credentials: false
# ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip hatch
# python -m hatch env create integration
# - name: Run integration tests
# env:
# TERM: unknown
# SNOWFLAKE_CONNECTIONS_INTEGRATION_USER: ${{ secrets.SNOWFLAKE_USER }}
# SNOWFLAKE_CONNECTIONS_INTEGRATION_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
# SNOWFLAKE_CONNECTIONS_INTEGRATION_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
# run: python -m hatch run integration:test
# # Update check run called "integration-fork"
# - uses: actions/github-script@v7
# id: update-check-run
# if: ${{ always() }}
# env:
# number: ${{ github.event.client_payload.pull_request.number }}
# job: ${{ github.job }}
# # Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
# conclusion: ${{ job.status }}
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const { data: pull } = await github.rest.pulls.get({
# ...context.repo,
# pull_number: process.env.number
# });
# const ref = pull.head.sha;
#
# const { data: checks } = await github.rest.checks.listForRef({
# ...context.repo,
# ref
# });
#
# const check = checks.check_runs.filter(c => c.name === process.env.job);
#
# const { data: result } = await github.rest.checks.update({
# ...context.repo,
# check_run_id: check[0].id,
# status: 'completed',
# conclusion: process.env.conclusion
# });
#
# return result;
Loading