Skip to content

Commit

Permalink
CI improvements (#3505)
Browse files Browse the repository at this point in the history
* Enable dependabot updates for actions (#86775)

Makes sure we're on the latest versions of the stuff we never check
(i.e. actions/checkout).

* Post release notes in DMAPI PR body (#85723)

- Change committer to tgstation-server-ci[bot]

Also denaturing DMAPI slightly so I can test.

* Add start and completion gates to CI (#86510)

Start gate means we only need to check `[ci skip]` once

Completion gate means we need only one status check in our rulesets.

* Fix alternate tests checking (#86530)

* Fix "Compile All Maps" and "Run Linters" not being required status checks (#86532)

🫠

* Fix required status checks (#86739)

TL;DR GitHub is trash
https://emmer.dev/blog/skippable-github-status-checks-aren-t-really-required/

* Disable northstar (and its CI)

* Fix TGS Test (#86840)

TGS now does some validation of the access token you give it, which
doesn't work well in an actions environment. Just don't give it a token
unless absolutely necessary.

Private repos can eat shit cause this is AGPL code.

* Tells od lints to shut the fuck up (#84069)

## About The Pull Request

I want this lint to go away. it's killing me internally.
## Why It's Good For The Game

It's a pragma that no longer exists

* Adds OD's new pragma to lints, fixes all issues it found (#86568)

Closes #86567
Don't think any of these were found/reported or actually could trigger
in-game

Glory to OpenDream

:cl:
code: Fixed multiple minor logic issues with code found by OpenDream's
new pragma
/:cl:

* fix linter warnings

---------

Co-authored-by: Jordan Dominion <[email protected]>
Co-authored-by: Zephyr <[email protected]>
Co-authored-by: SmArtKar <[email protected]>
  • Loading branch information
4 people authored Sep 24, 2024
1 parent 2344335 commit 9664346
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 46 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: github-actions
directory: /
target-branch: master
schedule:
interval: daily
labels:
- GitHub
open-pull-requests-limit: 10
47 changes: 27 additions & 20 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ concurrency:
cancel-in-progress: true

jobs:
run_linters:
start_gate:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Start Gate
runs-on: ubuntu-latest
steps:
- name: Mandatory Empty Step
run: exit 0

run_linters:
name: Run Linters
needs: start_gate
runs-on: ubuntu-22.04
timeout-minutes: 5

Expand Down Expand Up @@ -122,9 +130,8 @@ jobs:
run: tools/build/build --ci lint tgui-test

compile_all_maps:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Compile Maps
needs: [collect_data]
needs: collect_data
runs-on: ubuntu-22.04
timeout-minutes: 5

Expand All @@ -147,8 +154,8 @@ jobs:
max-required-client-version: ${{needs.collect_data.outputs.max_required_byond_client}}

collect_data:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Collect data for other tasks
needs: start_gate
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
Expand Down Expand Up @@ -177,9 +184,8 @@ jobs:
echo "max_required_byond_client=$(grep -Ev '^[[:blank:]]{0,}#{1,}|^[[:blank:]]{0,}$' .github/max_required_byond_client.txt | tail -n1)" >> $GITHUB_OUTPUT
run_all_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Integration Tests
needs: [collect_data]
needs: collect_data

strategy:
fail-fast: false
Expand All @@ -192,9 +198,9 @@ jobs:
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}

run_alternate_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && needs.collect_data.outputs.alternate_tests != '[]' )
if: needs.collect_data.outputs.alternate_tests != '[]'
name: Alternate Tests
needs: [collect_data]
needs: collect_data
strategy:
fail-fast: false
matrix:
Expand All @@ -207,18 +213,9 @@ jobs:
minor: ${{ matrix.setup.minor }}
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}

check_alternate_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && needs.collect_data.outputs.alternate_tests != '[]' )
name: Check Alternate Tests
needs: [run_alternate_tests]
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- run: echo Alternate tests passed.

compare_screenshots:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && (success() || failure()) )
needs: [run_all_tests, run_alternate_tests]
if: needs.collect_data.outputs.alternate_tests == '[]' || needs.run_alternate_tests.result == 'success'
needs: [ collect_data, run_all_tests, run_alternate_tests ]
name: Compare Screenshot Tests
timeout-minutes: 15
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -255,7 +252,6 @@ jobs:
path: artifacts/screenshot_comparisons

test_windows:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Windows Build
needs: [collect_data]
runs-on: windows-latest
Expand All @@ -279,3 +275,14 @@ jobs:
with:
dmb-location: tgstation.dmb
max-required-client-version: ${{needs.collect_data.outputs.max_required_byond_client}}

completion_gate: # Serves as a non-moving target for branch rulesets
if: always() && !cancelled()
name: Completion Gate
needs: [ test_windows, compare_screenshots, compile_all_maps, run_linters ]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
3 changes: 2 additions & 1 deletion .github/workflows/update_tgs_dmapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: Apply DMAPI update
uses: tgstation/tgs-dmapi-updater@v2
id: dmapi-update
with:
header-path: 'code/__DEFINES/tgs.dm'
library-path: 'code/modules/tgs'
Expand All @@ -41,7 +42,7 @@ jobs:
source_branch: "tgs-dmapi-update"
destination_branch: "master"
pr_title: "Automatic TGS DMAPI Update"
pr_body: "This pull request updates the TGS DMAPI to the latest version. Please note any changes that may be breaking or unimplemented in your codebase by checking what changes are in the definitions file: code/__DEFINES/tgs.dm before merging."
pr_body: "This pull request updates the TGS DMAPI to the latest version. Please note any changes that may be breaking or unimplemented in your codebase by checking what changes are in the definitions file: code/__DEFINES/tgs.dm before merging.\n\n${{ steps.dmapi-update.outputs.release-notes }}"
pr_label: "Tools"
pr_allow_empty: false
github_token: ${{ secrets.COMFY_ORANGE_PAT || secrets.GITHUB_TOKEN }}
File renamed without changes.
4 changes: 2 additions & 2 deletions code/datums/wounds/_wounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
// check if we have a valid treatable tool
if(potential_treater.tool_behaviour in treatable_tools)
return TRUE
if(TOOL_CAUTERY in treatable_tools && potential_treater.get_temperature() && user == victim) // allow improvised cauterization on yourself without an aggro grab
if((TOOL_CAUTERY in treatable_tools) && potential_treater.get_temperature() && user == victim) // allow improvised cauterization on yourself without an aggro grab
return TRUE
// failing that, see if we're aggro grabbing them and if we have an item that works for aggro grabs only
if(user.pulling == victim && user.grab_state >= GRAB_AGGRESSIVE && check_grab_treatments(potential_treater, user))
Expand Down Expand Up @@ -687,7 +687,7 @@

var/datum/wound_pregen_data/pregen_data = get_pregen_data()

if (WOUND_BLUNT in pregen_data.required_wounding_types && severity >= WOUND_SEVERITY_CRITICAL)
if ((WOUND_BLUNT in pregen_data.required_wounding_types) && severity >= WOUND_SEVERITY_CRITICAL)
return WOUND_CRITICAL_BLUNT_DISMEMBER_BONUS // we only require mangled bone (T2 blunt), but if there's a critical blunt, we'll add 15% more

/// Returns our pregen data, which is practically guaranteed to exist, so this proc can safely be used raw.
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
. = TRUE
if("select_stencil")
var/stencil = params["item"]
if(stencil in all_drawables + randoms)
if(stencil in (all_drawables + randoms))
drawtype = stencil
. = TRUE
text_buffer = ""
Expand Down Expand Up @@ -441,7 +441,7 @@
temp = "symbol"
else if(drawing in drawings)
temp = "drawing"
else if(drawing in graffiti|oriented)
else if(drawing in (graffiti|oriented))
temp = "graffiti"

var/graf_rot
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/pet_carrier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
occupant_weight -= L.mob_size

/obj/item/pet_carrier/handle_atom_del(atom/A)
if(A in occupants && isliving(A))
if((A in occupants) && isliving(A))
var/mob/living/L = A
occupants -= L
occupant_weight -= L.mob_size
Expand Down Expand Up @@ -180,7 +180,7 @@
add_occupant(target)

/obj/item/pet_carrier/proc/add_occupant(mob/living/occupant)
if(occupant in occupants || !istype(occupant))
if((occupant in occupants) || !istype(occupant))
return
occupant.forceMove(src)
occupants += occupant
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/permissionedit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
. = ckey(admin_key)
if(!.)
return FALSE
if(!admin_ckey && (. in GLOB.admin_datums+GLOB.deadmins))
if(!admin_ckey && (. in (GLOB.admin_datums+GLOB.deadmins)))
to_chat(usr, span_danger("[admin_key] is already an admin."), confidential = TRUE)
return FALSE
if(use_db)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/blob/overmind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
if(isnull(guy_turf) || !is_station_level(guy_turf.z))
continue

if(live_guy in GLOB.overminds || (live_guy.pass_flags & PASSBLOB))
if((live_guy in GLOB.overminds) || (live_guy.pass_flags & PASSBLOB))
continue

var/area/blob_area = get_area(guy_turf)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/changeling/powers/fakedeath.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
return

var/datum/antagonist/changeling/ling = user.mind?.has_antag_datum(/datum/antagonist/changeling)
if(QDELETED(ling) || !(src in ling.innate_powers + ling.purchased_powers)) // checking both innate and purchased for full coverage
if(QDELETED(ling) || !(src in (ling.innate_powers + ling.purchased_powers))) // checking both innate and purchased for full coverage
return
if(!HAS_TRAIT_FROM(user, TRAIT_DEATHCOMA, CHANGELING_TRAIT))
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/heretic/knowledge/rust_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
max_dist = max(max_dist, get_dist(found_turf, centre) + 1)

for(var/turf/nearby_turf as anything in spiral_range_turfs(max_dist, centre, FALSE))
if(nearby_turf in rusted_turfs || is_type_in_typecache(nearby_turf, blacklisted_turfs))
if((nearby_turf in rusted_turfs) || is_type_in_typecache(nearby_turf, blacklisted_turfs))
continue

for(var/turf/line_turf as anything in get_line(nearby_turf, centre))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/heretic/magic/ash_ascension.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
if(L.can_block_magic())
L.visible_message(span_danger("The spell bounces off of [L]!"), span_danger("The spell bounces off of you!"))
continue
if(L in hit_list || L == source)
if((L in hit_list) || L == source)
continue
hit_list += L
L.adjustFireLoss(20)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/revolution/revolution.dm
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
if (!(player_mind.assigned_role.departments_bitflags & (DEPARTMENT_BITFLAG_SECURITY|DEPARTMENT_BITFLAG_COMMAND)))
continue

if (player_mind in ex_revs + ex_headrevs)
if (player_mind in (ex_revs + ex_headrevs))
continue

if (!istype(player))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/client/verbs/ooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")

msg = emoji_parse(msg)

if(SSticker.HasRoundStarted() && (msg[1] in list(".",";",":","#") || findtext_char(msg, "say", 1, 5)))
if(SSticker.HasRoundStarted() && ((msg[1] in list(".",";",":","#")) || findtext_char(msg, "say", 1, 5)))
if(tgui_alert(usr,"Your message \"[raw_msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", list("Yes", "No")) != "Yes")
return

Expand Down
2 changes: 1 addition & 1 deletion code/modules/religion/sparring/sparring_contract.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
if(!isnull(resolved))
resolved_opponents += resolved

if(user in resolved_opponents && params["stakes"] == STAKES_HOLY_MATCH)
if((user in resolved_opponents) && params["stakes"] == STAKES_HOLY_MATCH)
to_chat(user, span_warning("This contract refuses to be signed up for a holy match by a previous holy match loser. Pick a different stake!"))

//any updating of the terms should update the UI to display new terms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Slimecrossing Armor
var/hit_reflect_chance = 40

/obj/item/clothing/suit/armor/heavy/adamantine/IsReflect(def_zone)
if(def_zone in list(BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) && prob(hit_reflect_chance))
if((def_zone in list(BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)) && prob(hit_reflect_chance))
return TRUE
else
return FALSE
2 changes: 2 additions & 0 deletions code/modules/tgs/core/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ TGS_DEFINE_AND_SET_GLOBAL(tgs, null)
src.event_handler = event_handler
src.version = version

// chumbis

/datum/tgs_api/proc/TerminateWorld()
while(TRUE)
TGS_DEBUG_LOG("About to terminate world. Tick: [world.time], sleep_offline: [world.sleep_offline]")
Expand Down
8 changes: 4 additions & 4 deletions config/maps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ map tramstation
votable
endmap

map northstar
minplayers 50
votable
endmap
#map northstar
# minplayers 50
# votable
#endmap

map runtimestation
endmap
Expand Down
2 changes: 1 addition & 1 deletion monkestation/code/modules/blueshift/items/badges.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
if(istype(object, /obj/item/card/id))
id_card = object

if(ACCESS_SECURITY in id_card.access || (obj_flags & EMAGGED))
if((ACCESS_SECURITY in id_card.access) || (obj_flags & EMAGGED))
to_chat(user, "You imprint your ID details onto the badge.")
set_name(user.real_name)
badge_string = id_card.assignment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/obj/item/reagent_containers/cup/glass/bottle/small/brewing_bottle/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(target.type in typesof(/obj/item/reagent_containers/cup/glass) - typesof(/obj/item/reagent_containers/cup/glass/bottle))
if(target.type in (typesof(/obj/item/reagent_containers/cup/glass) - typesof(/obj/item/reagent_containers/cup/glass/bottle)))
if(glass_name)
target.name = glass_name
if(glass_desc)
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/od_lints.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#pragma SoftReservedKeyword error
#pragma DuplicateVariable error
#pragma DuplicateProcDefinition error
#pragma TooManyArguments error
#pragma PointlessParentCall error
#pragma PointlessBuiltinCall error
#pragma SuspiciousMatrixCall error
Expand All @@ -31,3 +30,4 @@
#pragma UnsafeClientAccess disabled
#pragma SuspiciousSwitchCase error
#pragma AssignmentInConditional error
#pragma AmbiguousInOrder error
4 changes: 1 addition & 3 deletions tools/tgs_test/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Simple app meant to test tgstation's TGS integration given a fresh TGS install with the default account
//
// Args: Repository Owner/Name, TGS instance path, TGS API port, Pushed commit hash (For .tgs.yml access), GitHub Token, (OPTIONAL) PR Number
// Args: Repository Owner/Name, TGS instance path, TGS API port, Pushed commit hash (For .tgs.yml access), GitHub Token, (OPTIONAL) PR Number

using System.Reflection;
using System.Text;
Expand Down Expand Up @@ -197,8 +197,6 @@
{
Origin = new Uri($"http://github.com/{repoSlug}"),
UpdateSubmodules = true,
AccessUser = "Testing",
AccessToken = gitHubToken
},
default);

Expand Down

0 comments on commit 9664346

Please sign in to comment.