File tree 4 files changed +28
-8
lines changed 4 files changed +28
-8
lines changed Original file line number Diff line number Diff line change 17
17
- uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
18
18
- name : Build the Docker image
19
19
run : make compose/rebuild
20
+ - name : Run static checks in Docker image
21
+ run : make compose/lint
20
22
- name : Run test in Docker image
21
23
run : make compose/run
22
24
- name : Tag Docker image
23
25
run : docker tag algorithm-exercises-py:latest algorithm-exercises-py:${{ github.sha }}
26
+
27
+ - name : Run Snyk to check Docker image for vulnerabilities
28
+ # Snyk can be used to break the build when it detects vulnerabilities.
29
+ # In this case we want to upload the issues to GitHub Code Scanning
30
+ continue-on-error : true
31
+ uses : snyk/actions/docker@master
32
+ env :
33
+ # In order to use the Snyk Action you will need to have a Snyk API token.
34
+ # See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
35
+ # or you can sign up for free at https://snyk.io/login
36
+ SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
37
+ with :
38
+ image : algorithm-exercises-py:latest
39
+ args : --file=Dockerfile
40
+ # - name: Upload result to GitHub Code Scanning
41
+ # uses: github/codeql-action/upload-sarif@v2
42
+ # with:
43
+ # sarif_file: snyk.sarif
Original file line number Diff line number Diff line change @@ -5,16 +5,15 @@ ENV WORKDIR=/app
5
5
WORKDIR ${WORKDIR}
6
6
7
7
# ##############################################################################
8
- FROM node:20.14.0-alpine3.20 AS lint
8
+ FROM base AS lint
9
9
10
10
ENV WORKDIR=/app
11
11
WORKDIR ${WORKDIR}
12
12
13
13
COPY ./src ${WORKDIR}/src
14
- RUN apk add --update --no-cache make
15
- RUN npm install -g --ignore-scripts markdownlint-cli
14
+ RUN apk add --update --no-cache make nodejs npm
16
15
17
- RUN apk add --update --no-cache nodejs npm
16
+ RUN npm install -g --ignore-scripts markdownlint-cli
18
17
RUN npm install -g --ignore-scripts pyright
19
18
20
19
# ##############################################################################
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ clean:
110
110
find . -path " */__pycache__" -type d -print -exec rm -fr {} ' ;'
111
111
112
112
compose/build : env
113
+ docker-compose --profile lint build
113
114
docker-compose --profile testing build
114
115
115
116
compose/rebuild : env
@@ -118,10 +119,10 @@ compose/rebuild: env
118
119
119
120
compose/mdlint : env
120
121
docker-compose --profile lint build
121
- docker-compose --profile lint run --rm algorithm-exercises-py-mdlint make mdlint
122
+ docker-compose --profile lint run --rm algorithm-exercises-py-lint make mdlint
122
123
123
124
compose/test/static : compose/build
124
- docker-compose --profile testing run --rm algorithm-exercises-py make test/static
125
+ docker-compose --profile lint run --rm algorithm-exercises-py-lint make test/static
125
126
126
127
compose/lint : compose/test/static compose/mdlint
127
128
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ services:
11
11
- ./coverage:/app/coverage
12
12
profiles : ["testing"]
13
13
14
- algorithm-exercises-py-mdlint :
15
- image : algorithm-exercises-ts:mdlint
14
+ algorithm-exercises-py-lint :
15
+ image : algorithm-exercises-py:lint
16
16
build :
17
17
context : .
18
18
target : lint
You can’t perform that action at this time.
0 commit comments