-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (118 loc) · 4.34 KB
/
Copy pathgithub_actions.yaml
File metadata and controls
145 lines (118 loc) · 4.34 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Vantage6 Algorithm CI
on:
push:
branches:
- main
tags:
- 'release/v*.*.*'
- 'dev'
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
permissions:
contents: read
packages: write
jobs:
lint-and-test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Set up Python 3.11
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
# Validation stays manual-only for now.
# Manual walkthrough status:
# - bootstrap scripts now self-select Python >= 3.10 and use a shared env
# - clean-env validation passes
# - stress_matrix still fails in tests/infra/prepare_meta_smoke_data.py on missing D2T criteria columns
# validation-baseline:
# name: Validation Baseline
# runs-on: ubuntu-latest
# timeout-minutes: 45
# steps:
# - name: Checkout repository
# uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
# - name: Checkout infra harness
# uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
# with:
# repository: mdw-nl/v6-infrastructure-sh
# ref: 3133deb74a30fe34617d69d94628bbff38c71869
# path: tools/v6-infra
# - name: Set up Python 3.12
# uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
# with:
# python-version: "3.12"
# - name: Docker info
# run: docker info
# - name: Clean environment validation
# run: PYTHON_BOOTSTRAP=python3 bash scripts/ci/clean_env_validate.sh
# - name: Local stress matrix
# run: python3 scripts/ci/stress_matrix.py
# - name: Infra baseline validation
# run: |
# INFRA_DIR="$GITHUB_WORKSPACE/tools/v6-infra" \
# PYTHON_BOOTSTRAP=python3 \
# V6_INFRA_PROFILE=baseline \
# bash scripts/ci/run_infra_lane.sh
# - name: Validation report
# if: always()
# run: python3 scripts/ci/report_summary.py
# - name: Upload validation artifacts
# if: always()
# uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
# with:
# name: validation-artifacts
# path: ARTIFACTS/validation
build-and-push:
name: Build and Push Docker Image
if: startsWith(github.ref, 'refs/tags/release/v') || github.ref == 'refs/tags/dev'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Extract tag name
id: extract_tag
run: |
RAW_TAG="${GITHUB_REF#refs/tags/}"
RELEASE_TAG="${RAW_TAG#release/}"
SAFE_TAG="${RAW_TAG//\//-}"
echo "raw_tag=${RAW_TAG}" >> "$GITHUB_OUTPUT"
echo "release_tag=${RELEASE_TAG}" >> "$GITHUB_OUTPUT"
echo "safe_tag=${SAFE_TAG}" >> "$GITHUB_OUTPUT"
- name: Downcase REPO name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image (release)
if: startsWith(github.ref, 'refs/tags/release/v')
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
with:
context: ./
push: true
tags: |
ghcr.io/${{ env.REPO }}:latest
ghcr.io/${{ env.REPO }}:${{ steps.extract_tag.outputs.release_tag }}
- name: Build and push Docker image (dev)
if: github.ref == 'refs/tags/dev'
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
with:
context: ./
push: true
tags: ghcr.io/${{ env.REPO }}:dev