-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
129 lines (120 loc) · 4.32 KB
/
.gitlab-ci.yml
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
# cwtools-action v1.0, 2019-12-02
# Please occasionally check below for updates to this template
# https://github.com/cwtools/cwtools-action
# Example GitLab CI workflow file for a Stellaris project
# Will trigger when a merge request to master is created
# Rename to .gitlab-ci.yml and put in root of your repository
image: mcr.microsoft.com/dotnet/core/sdk:3.0
variables:
DOCKER_DRIVER: overlay2
GIT_STRATEGY: clone # Please see https://github.com/cwtools/cwtools-action/issues/3 for details as to why this is needed
INPUT_GAME: "hoi4" # Change to the game used in your project
# Variables below are optional and set to their default values - uncomment and change them if you wish so
#INPUT_MODPATH: ''
#INPUT_CACHE: ''
#INPUT_LOCLANGUAGES: 'english'
INPUT_RULES: 'https://github.com/Kaiserreich/cwtools-hoi4-config.git' # I maintain this repo with Pelman from KR - Bird
INPUT_RULESREF: 'master'
#INPUT_VANILLAMODE: '0'
#For CW226: Localisation key commands aren't supported, issue report here: https://github.com/cwtools/cwtools-hoi4-config/issues/65
#for CW251: AND is unneeded warnings Bird Need to fix
INPUT_SUPPRESSEDOFFENCECATEGORIES: '{"failure":["CW226"], "warning":["CW251"], "notice":[]}'
#INPUT_SUPPRESSEDFILES: '[]'
#INPUT_CWTOOLSCLIVERSION: ''
stages:
- codingstandards
- styling
- correctstyling
- release
# CodingStandards Section
CodingStandards:
stage: codingstandards
image:
name: broadinstitute/python-requests
entrypoint: [""]
interruptible: true
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /skip-coding-pipeline/'
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
script:
- python tools/coding_standards.py $Bot_Token
CWTools_CI:
stage: codingstandards
interruptible: true
tags:
- cwtools
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /skip-coding-pipeline/'
when: never
- if: '$CI_MERGE_REQUEST_LABELS =~ /skip-cwtools-job/'
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
script:
- echo "Pulling down the CWTools action validator"
- wget -O - -q https://raw.githubusercontent.com/cwtools/cwtools-action/v1.0.0/lib/gitlab_setup.sh | sh -s
# Optional, expose the CWTools errors in JSON
artifacts:
expose_as: 'CWTools Build Output'
paths:
- output.json
when: always
# Stylization Section
Styling:
stage: styling
image:
name: broadinstitute/python-requests
entrypoint: [""]
interruptible: true
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /skip-coding-pipeline/'
when: never
- if: '$CI_MERGE_REQUEST_LABELS =~ /skip-cwtools-job/'
when: always
needs: ["CodingStandards"]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
needs: ["CodingStandards", "CWTools_CI"]
script:
- python tools/check_basic_style_2.py $Bot_Token
FixingStyling:
stage: correctstyling
image:
name: broadinstitute/python-requests
entrypoint: [""]
interruptible: true
needs: ["Styling"]
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /skip-coding-pipeline/'
when: never
- if: '$CI_MERGE_REQUEST_LABELS =~ /skip-fixing-styling/'
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_failure
script:
- apt-get install -y git
- python tools/fix_styling.py $Bot_Token
after_script:
- git config --global user.email "[email protected]"
- git config --global user.name "millennium_dawn_cwtools"
- git config --global push.default simple
- git remote set-url origin https://millennium_dawn_cwtools:[email protected]/Millennium_Dawn/Millennium_Dawn.git
- git add -A
- git commit -m 'Fixed Styling for you'
- git push -u origin HEAD:$CI_COMMIT_REF_NAME
- python tools/check_basic_style.py $Bot_Token
- python tools/check_basic_style_2.py $Bot_Token
# This section is purely to create a releasable off the most recent commit on this tag. This should allow me to save some time in creating releasable assets.
create_releaseable:
stage: release
rules:
- if: $CI_COMMIT_TAG
script:
- echo 'Creating a Release'
- curl --location --output /usr/local/bin/release-cli "https://release-cli-downloads.s3.amazonaws.com/latest/release-cli-linux-amd64"
- chmod +x /usr/local/bin/release-cli
release:
tag_name: '$CI_COMMIT_TAG' # The version is incremented per pipeline.
description: 'Release for $CI_COMMIT_TAG from $CI_COMMIT_SHA $CI_COMMIT_TIMESTAMP'