Skip to content

Commit

Permalink
Merge branch 'devel' into cuda_main
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBourne committed Aug 15, 2023
2 parents 2d3c15b + 4943108 commit c5c2b48
Show file tree
Hide file tree
Showing 223 changed files with 9,192 additions and 5,747 deletions.
1 change: 1 addition & 0 deletions .dict_custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ RedBaron
intel
nvidia
boolean
booleans
quicksort
iterm
textx
Expand Down
3 changes: 3 additions & 0 deletions .docstr_coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.*code _print_.*
semantic _visit_.*
syntactic _visit_.*
7 changes: 6 additions & 1 deletion .github/actions/coverage_collection/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
name: 'Coverage Collection'
inputs:
shell_cmd:
description: 'Specifies the shell command (different for anaconda)'
required: false
default: 'bash'

runs:
using: "composite"
Expand All @@ -7,5 +12,5 @@ runs:
run: |
coverage combine
rm ${SITE_DIR}/pyccel_cov.pth
shell: bash
shell: ${{ inputs.shell_cmd }}

9 changes: 7 additions & 2 deletions .github/actions/coverage_install/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: 'Coverage Setup'
inputs:
shell_cmd:
description: 'Specifies the shell command (different for anaconda)'
required: false
default: 'bash'

runs:
using: "composite"
steps:
- name: Installation
run: |
python -m pip install coverage
shell: bash
shell: ${{ inputs.shell_cmd }}
- name: Directory Creation
run: |
INSTALL_DIR=$(cd tests; python -c "import pyccel; print(pyccel.__path__[0])")
Expand All @@ -15,4 +20,4 @@ runs:
echo -e "[run]\nparallel = True\nsource = ${INSTALL_DIR}\ndata_file = $(pwd)/.coverage\n[report]\ninclude = ${INSTALL_DIR}/*\n[xml]\noutput = cobertura.xml" > .coveragerc
echo "SITE_DIR=${SITE_DIR}" >> $GITHUB_ENV
echo "COVERAGE_PROCESS_START=$(pwd)/.coveragerc" >> $GITHUB_ENV
shell: bash
shell: ${{ inputs.shell_cmd }}
23 changes: 23 additions & 0 deletions .github/actions/generate_bot_token/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Generate bot token"
inputs:
bot_pem:
description: "The private key which identifies the bot"
required: true
dir:
description: "The directory where the code is found"
required: false
default: "."

runs:
using: "composite"
steps:
- run: |
pip install jwt requests
shell: bash
- run: |
cd ${{ inputs.dir }}
python -c "from ci_tools.bot_tools.github_api_interactions import get_authorization; t,d=get_authorization(); print('token=',t,sep=''); print('token_exp=',d,sep='')"
shell: bash
id: get_token
env:
PEM: ${{ inputs.bot_pem }}
34 changes: 34 additions & 0 deletions .github/actions/post_completed/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Posting in progress status'
inputs:
installation_token:
description: "The GitHub API token of the bot"
required: true
run_id:
description: "The id of the check run"
required: true
status:
description: "The final status of the workflow"
required: true

runs:
using: "composite"
steps:
- name: "Collecting status"
run: |
import os
import json
import requests
if os.path.exists('test_json_result.json'):
with open('test_json_result.json', 'r') as f:
result = json.load(f)
else:
result = {}
result["status"] = "completed"
result["conclusion"] = "${{ inputs.status }}"
headers = {"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ inputs.installation_token }}", "X-GitHub-Api-Version": "2022-11-28"}
reply = requests.patch("https://api.github.com/repos/${{ github.repository }}/check-runs/${{ inputs.run_id }}", headers=headers, json=result)
print(reply.text)
shell: python
39 changes: 39 additions & 0 deletions .github/actions/post_triggered/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Posting in progress status'
inputs:
ref:
description: "The ref to post the status to"
required: true
installation_token:
description: "The GitHub API token of the bot"
required: true
name:
description: "The name of the workflow"
required: true
outputs:
check_id:
description: "The ID of the check run"
value: ${{ steps.post.outputs.check_id }}

runs:
using: "composite"
steps:
- name: "Posting"
run: |
import requests
headers = {"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ inputs.installation_token }}", "X-GitHub-Api-Version": "2022-11-28"}
data = {"name":"${{ inputs.name }}",
"head_sha":"${{ inputs.ref }}",
"status":"in_progress",
"details_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
reply = requests.post("https://api.github.com/repos/${{ github.repository }}/check-runs", headers=headers, json=data)
print(reply.text)
print(reply.json())
id = reply.json()["id"]
with open("${{ github.output }}", 'a') as f:
print("check_id=", id, sep='', file=f)
shell: python
id: post
62 changes: 52 additions & 10 deletions .github/actions/pytest_run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,72 @@ inputs:
runs:
using: "composite"
steps:
- name: Test with pytest
- name: Set up runner
run: |
which python
if [ -n "${{ runner.debug }}" ]
then
# If running in debug mode
export "DEBUG=1"
echo "DEBUG=1" >> $GITHUB_ENV
export FLAGS="-xsv --log-cli-level DEBUG"
else
export FLAGS=""
fi
python -m pytest -n auto -rXx ${FLAGS} -m "not (parallel or xdist_incompatible) and c ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays
if [ -n "${SITE_DIR}" ]; then
echo "FLAGS=${FLAGS}" >> $GITHUB_ENV
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
- name: Pytest with options (1)
run: python -m pytest -n auto -rXx ${FLAGS} -m "not (parallel or xdist_incompatible) and c ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays 2>&1 | tee s1_outfile.out
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_1
- name: if SITE_DIR is set (2)
run: |
if [ -n "${SITE_DIR}" ]; then
echo "Touching"
# Test ndarray folder update (requires parallel tests to avoid clean)
touch ${SITE_DIR}/pyccel/stdlib/cwrapper/cwrapper.h
python -m pytest -n auto -rXx ${FLAGS} -m c -k test_array_int32_1d_scalar epyccel/test_arrays.py
python -m pytest -n auto -rXx ${FLAGS} -m c -k test_array_int32_1d_scalar epyccel/test_arrays.py 2>&1 | tee s2_outfile.out
fi
python -m pytest -rXx ${FLAGS} -m "xdist_incompatible and not parallel and c ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays
pyccel-clean
python -m pytest -n auto -rXx ${FLAGS} -m "not (parallel or xdist_incompatible) and not (c or python or ccuda) ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays
python -m pytest -rXx ${FLAGS} -m "xdist_incompatible and not parallel and not (c or python or ccuda) ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_2
- name: pytest with options (3)
run: |
python -m pytest -rXx ${FLAGS} -m "xdist_incompatible and not parallel and c ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays 2>&1 | tee s3_outfile.out
pyccel-clean
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_3
- name: pytest with options (4)
run: python -m pytest -n auto -rXx ${FLAGS} -m "not (parallel or xdist_incompatible) and not (c or python or ccuda) ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays 2>&1 | tee s4_outfile.out
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_4
- name: pytest with options (5)
run: |
python -m pytest -rXx ${FLAGS} -m "xdist_incompatible and not parallel and not (c or python or ccuda) ${{ inputs.pytest_mark }}" --ignore=symbolic --ignore=ndarrays | tee s5_outfile.out
pyccel-clean
python -m pytest ndarrays/ -rXx ${FLAGS}
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_5
- name: pytest ndarrays (6)
run: |
python -m pytest ndarrays/ -rXx ${FLAGS} 2>&1 | tee s6_outfile.out
pyccel-clean
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_6
- name: Final step
if: always()
id: status
run:
python ci_tools/json_pytest_output.py -t "Linux Test Summary" --tests "C tests:${{ steps.pytest_1.outcome }}:tests/s1_outfile.out" \
"Verification of stdlib update:${{ steps.pytest_2.outcome }}:tests/s2_outfile.out" \
"Non-parallelisable C tests:${{ steps.pytest_3.outcome }}:tests/s3_outfile.out" \
"Fortran tests:${{ steps.pytest_4.outcome }}:tests/s4_outfile.out" \
"Non-parallelisable Fortran tests:${{ steps.pytest_5.outcome }}:tests/s5_outfile.out" \
"Ndarray tests for C stdlib:${{ steps.pytest_6.outcome }}:tests/s6_outfile.out"

shell: ${{ inputs.shell_cmd }}

Loading

0 comments on commit c5c2b48

Please sign in to comment.