-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (67 loc) · 1.98 KB
/
test.yml
File metadata and controls
80 lines (67 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches:
- master
pull_request_target:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.pip
- name: Check Docker Hub Status
uses: crazy-max/ghaction-docker-status@v4
with:
overall_threshold: degraded_performance
authentication_threshold: service_disruption
hub_registry_threshold: service_disruption
- name: Log in to DockerHub
uses: docker/login-action@v4.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
ecr: auto
logout: true
- name: Verify Docker Login
run: docker info
- name: Build and Push Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest
secrets: |
DOCKER_IMAGE=${{ secrets.DOCKER_IMAGE }}
- name: Pull Docker Image
run: docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest
- name: Docker Scout
id: docker-scout
uses: docker/scout-action@v1.20.4
with:
command: cves,recommendations,compare
image: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest
to-latest: true
ignore-base: true
ignore-unchanged: true
only-fixed: true
organization: ${{ secrets.DOCKER_USERNAME }}
summary: true
format: json
github-token: ${{ secrets.GITHUB_TOKEN }}
write-comment: true
- name: Run tests
run: python -m unittest discover