Skip to content

Commit

Permalink
Fork test
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astus committed Jul 19, 2024
1 parent 59905dc commit 350a99d
Showing 1 changed file with 56 additions and 51 deletions.
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;

0 comments on commit 350a99d

Please sign in to comment.