-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: create troubleshooting file for remote triggering
this should do the same as the build action when remotely triggered, but in a separate file for testing purposes
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# This file exists just for troubleshooting purposes | ||
name: Remote Build Trigger | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
caller_branch: | ||
required: true | ||
type: string | ||
remote: | ||
required: true | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
name: Remote build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
python-version: ["3.10"] | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: EIT-ALIVE/eit_dash # needs to be made explicit to avoid the remote repo being used | ||
- name: Verify Repository Structure # echo debugging info in case things go haywire | ||
run: | | ||
echo "action triggered by: ${{github.event_name}}"; | ||
echo "Current directory: $(pwd)" | ||
ls -al | ||
echo "Contents of $GITHUB_WORKSPACE:" | ||
ls -al $GITHUB_WORKSPACE | ||
if [ -f $GITHUB_WORKSPACE/pyproject.toml ]; then | ||
echo "Contents of pyproject.toml:" | ||
cat $GITHUB_WORKSPACE/pyproject.toml | ||
else | ||
echo "pyproject.toml not found." | ||
exit 1 | ||
fi | ||
- name: Connect to Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: wbaccinelli | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Tests in Container | ||
run: > | ||
docker run | ||
--rm | ||
-v $GITHUB_WORKSPACE:/ci | ||
-e TEST_DATA=/eitprocessing | ||
ghcr.io/eit-alive/eittestdata:latest | ||
sh -c 'set -xe ; | ||
cd /ci ; | ||
python${{ matrix.python-version }} -m pip install --upgrade pip poetry ; | ||
poetry add git+https://github.com/EIT-ALIVE/eitprocessing.git#${{ inputs.caller_branch }} | ||
poetry install --with test ; | ||
poetry run pytest -v tests/unit_tests ; | ||
python${{ matrix.python-version }} -m build' |