Skip to content

Commit aa5e4c6

Browse files
committed
fix: avoid copying the project files
Signed-off-by: Niccolò Fei <[email protected]>
1 parent 38cd9e3 commit aa5e4c6

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

DEVELOPERS_DEVELOPERS_DEVELOPERS.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,16 @@ Example:
108108
109109
## How it works
110110
111-
The files in this repository are needed for the Dockerfile to build and run, of
112-
course. In addition, GitHub will copy the files in the **user's** GitHub
113-
workflow location to the Dockerfile too. This is how the folder with the JSON
114-
artifacts will get passed. When invoking with `act`, we are simulating this with
115-
the `-b` option.
116-
117-
In the Dockerfile, the `COPY . .` line will include the directory with the
118-
JSON test artifacts at build time.
119-
See [GitHub support for Dockerfile](https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions):
120-
121-
> Before the action executes, GitHub will mount the GITHUB_WORKSPACE directory
122-
> on top of anything that was at that location in the Docker image and set
123-
> GITHUB_WORKSPACE as the working directory.
124-
125-
**NOTE**: the behavior of the `COPY` command in Dockerfiles seems quite
126-
finicky on whether it's done recursively or not. The invocation used,
127-
`COPY . .`, ensures the copy is done recursively.
111+
`summarize_test_results.py` and its `requirements.txt` are needed for the
112+
Dockerfile to build and run.
113+
In addition, at runtime GitHub will copy the files in the **user's**
114+
`GITHUB_WORKSPACE` directory to the Dockerfile, by running the container with a
115+
bind mount similar to the following one:
116+
117+
```
118+
-v "/home/runner/work/ciclops/ciclops":"/github/workspace"
119+
```
120+
121+
and it will use that as the container's `WORKDIR`.
122+
This is how the folder with the JSON artifacts will get passed.
123+
When invoking with `act`, we are simulating this with the `-b` option.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM python:3.14-alpine
22

33
COPY requirements.txt ./
4+
COPY summarize_test_results.py ./
45
RUN pip install --no-cache-dir -r requirements.txt
5-
COPY . .
66

77
ENTRYPOINT [ "python", "/summarize_test_results.py"]
88
CMD ["--dir", "./test-artifacts"]

0 commit comments

Comments
 (0)