Skip to content

Commit 8ee60c9

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Docker] [Github-Actions] static check added before running tests. File format: re-indented.
1 parent 99d390b commit 8ee60c9

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

.github/workflows/docker-image.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
name: Docker Image CI
22

3-
43
on:
54
push:
6-
branches: [ main, develop, feature/* ]
5+
branches: [main, develop, feature/*]
76
pull_request:
8-
branches: [ main ]
7+
branches: [main]
98

109
permissions: read-all
1110

1211
jobs:
13-
1412
build:
1513
name: Build & Test in Docker
1614

1715
runs-on: ubuntu-latest
1816

1917
steps:
20-
- uses: actions/checkout@v4
21-
- name: Build the Docker image
22-
run: make compose/rebuild
23-
- name: Run test in Docker image
24-
run: make compose/run
25-
- name: Tag Docker image
26-
run: docker tag algorithm-exercises-csharp:latest algorithm-exercises-csharp:${{ github.sha }}
27-
28-
- name: Run Snyk to check Docker image for vulnerabilities
29-
# Snyk can be used to break the build when it detects vulnerabilities.
30-
# In this case we want to upload the issues to GitHub Code Scanning
31-
continue-on-error: true
32-
uses: snyk/actions/docker@master
33-
env:
34-
# In order to use the Snyk Action you will need to have a Snyk API token.
35-
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
36-
# or you can sign up for free at https://snyk.io/login
37-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
38-
with:
39-
image: algorithm-exercises-csharp:latest
40-
args: --file=Dockerfile
18+
- uses: actions/checkout@v4
19+
- name: Build the Docker image
20+
run: make compose/rebuild
21+
- name: Run static checks in Docker image
22+
run: make compose/lint
23+
- name: Run test in Docker image
24+
run: make compose/run
25+
- name: Tag Docker image
26+
run: docker tag algorithm-exercises-csharp:latest algorithm-exercises-csharp:${{ github.sha }}
27+
28+
- name: Run Snyk to check Docker image for vulnerabilities
29+
# Snyk can be used to break the build when it detects vulnerabilities.
30+
# In this case we want to upload the issues to GitHub Code Scanning
31+
continue-on-error: true
32+
uses: snyk/actions/docker@master
33+
env:
34+
# In order to use the Snyk Action you will need to have a Snyk API token.
35+
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
36+
# or you can sign up for free at https://snyk.io/login
37+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
38+
with:
39+
image: algorithm-exercises-csharp:latest
40+
args: --file=Dockerfile
4141
# - name: Upload result to GitHub Code Scanning
4242
# uses: github/codeql-action/upload-sarif@v2
4343
# with:

0 commit comments

Comments
 (0)