Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RU-Aurora-space-station13 committed Jun 7, 2024
2 parents 8fc8cb6 + d0032e5 commit 7d79d04
Show file tree
Hide file tree
Showing 2,495 changed files with 1,119,632 additions and 256,695 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/build_bapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build BAPI
on:
issue_comment:
types: [created]

jobs:
build-bapi:
if: |
github.event.issue.pull_request &&
(github.event.comment.body == '!build_bapi') &&
((github.event.sender.id == github.event.issue.user.id) ||
(github.event.comment.author_association == 'COLLABORATOR') ||
(github.event.comment.author_association == 'MEMBER') ||
(github.event.comment.author_association == 'OWNER'))
runs-on: ubuntu-latest
steps:
- name: Like the comment
env:
BASE_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$BASE_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
-f content='+1'
- name: PR Data
run: |
pr_json=$(curl -L -s --fail-with-body -H "Authorization: token ${{ github.token }}" ${{ github.event.issue.pull_request.url }})
if [ `jq -r '.maintainer_can_modify' <<<$pr_json` == "false" ] ; then
gh pr comment ${{ github.event.issue.html_url }} --body 'GitHub Actions can not push to the repository without "Allow edits and access to secrets by maintainers" checked.'
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV"
exit 1
fi
echo "PR_REPO=`jq -r '.head.repo.full_name' <<<$pr_json`" >> $GITHUB_ENV
echo "PR_BRANCH=`jq -r '.head.ref' <<<$pr_json`" >> $GITHUB_ENV
echo "PR_HEAD_LABEL=`jq -r '.head.label' <<<$pr_json`" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: ${{ env.PR_REPO }}
ref: ${{ env.PR_BRANCH }}
token: ${{ github.token }}

- name: Build BAPI
env:
BASE_BRANCH: ${{ github.event.repository.default_branch }}
BASE_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
# Get the code.
git config user.name AuroraBuildBot
git config user.email "[email protected]"
git pull origin "$PR_BRANCH" --depth=$((ahead_by + 1))
git remote add upstream "https://github.com/$BASE_REPOSITORY.git"
git fetch upstream "$BASE_BRANCH" --depth=$((behind_by + 1))
cd rust/bapi
# Get dependencies.
rustup target add i686-unknown-linux-gnu
rustup target add i686-pc-windows-gnu
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install zlib1g-dev:i386 lib32gcc-11-dev mingw-w64 mingw-w64-i686-dev
# Build it.
cargo build --release --target i686-unknown-linux-gnu
cargo build --release --target i686-pc-windows-gnu
# Copy the built targets to their checked-in locations.
cp target/i686-unknown-linux-gnu/release/libbapi.so ../../tools/ci/libbapi_ci.so
cp target/i686-pc-windows-gnu/release/bapi.dll ../../bapi.dll
# Check if a workflow file would be modified by the merge (permissions prevent pushes if so)
latest_workflow_commit=$(git log -n 1 --pretty=format:"%H" upstream/$BASE_BRANCH -- .github/workflows)
if ! git branch --contains $latest_workflow_commit | grep -q "$(git rev-parse --abbrev-ref HEAD)"; then
gh pr comment ${{ github.event.issue.html_url }} --body "GitHub Actions can not push to this branch as workflow files have been changed since your branch was last updated. Please update your branch past https://github.com/$BASE_REPOSITORY/commit/$latest_workflow_commit before using this command again."
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV"
exit 1
fi
git commit -a -m "Build BAPI" --allow-empty
git push origin
- name: Notify Failure
if: failure() && env.FAIL_NOTIFIED != 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr comment ${{ github.event.issue.html_url }} -b 'Building BAPI failed, see the action run log for details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
61 changes: 35 additions & 26 deletions .github/workflows/byond.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
FLYWAY_BUILD: ""
SPACEMAN_DMM_VERSION: ""
NODE_VERSION: ""
NODE_VERSION_PRECISE: ""
NODE_VERSION_LTS: ""
PYTHON_VERSION: ""

#If we want the runner to open an SSH shell for us to inspect it, fairly nieche, don't touch if you don't know what you're doing
Expand All @@ -35,6 +35,10 @@ env:
#The maximum number of retries the unit tests (excluding linters) can make, if appropriate for them to
CI_MAX_RETRIES: 3

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

###########################################
Expand Down Expand Up @@ -99,7 +103,7 @@ jobs:
# https://megalinter.io/latest/
- name: Check EditorConfig Compliance
id: ml
uses: oxsecurity/megalinter/flavors/python@v7.3.0
uses: oxsecurity/megalinter/flavors/python@v7.10.0
# Env config options outlined in https://megalinter.io/configuration/
env:
PRINT_ALPACA: false
Expand All @@ -112,7 +116,7 @@ jobs:
# Upload MegaLinter artifacts
- name: Upload Megalinter Artifacts
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
Expand Down Expand Up @@ -146,7 +150,7 @@ jobs:

#Restores SpacemanDMM from the cache repository
- name: Restore SpacemanDMM cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-spacemandmm-${{ env.SPACEMAN_DMM_VERSION }}
Expand Down Expand Up @@ -224,7 +228,7 @@ jobs:

#Restore YARN (Node packages) cache
- name: Restore Yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
Expand All @@ -237,7 +241,7 @@ jobs:
uses: actions/setup-node@v3
with:
cache-dependency-path: tgui/yarn.lock
node-version: ${{ env.NODE_VERSION_PRECISE }}
node-version: ${{ env.NODE_VERSION_LTS }}
cache: 'yarn'

#Lint TGUI
Expand Down Expand Up @@ -294,9 +298,14 @@ jobs:
run: |
tools/bootstrap/python -m dmi.test
- name: Check DMM-Test
- name: Run Map Checks
run: |
tools/bootstrap/python -m mapmerge2.dmm_test
tools/bootstrap/python -m tools.maplint.source
- name: Scan DMMs
run: |
tools/bootstrap/python -m dmm_scanner.scan_camera_ctags
###########################################
############## GENERIC TESTS ##############
Expand Down Expand Up @@ -349,13 +358,13 @@ jobs:

#Restores BYOND cache
- name: Restore BYOND cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/BYOND/*
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}

- name: Restore FlyWay cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/flyway
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }}
Expand Down Expand Up @@ -414,7 +423,7 @@ jobs:
(! grep "runtime error:" log.txt)
- name: Upload Condensed UT Log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() || ${{ runner.debug }}
with:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
Expand Down Expand Up @@ -472,13 +481,13 @@ jobs:

#Restores BYOND cache
- name: Restore BYOND cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/BYOND/*
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}

- name: Restore FlyWay cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/flyway
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }}
Expand Down Expand Up @@ -537,7 +546,7 @@ jobs:
(! grep "runtime error:" log.txt)
- name: Upload Condensed UT Log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() || ${{ runner.debug }}
with:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
Expand Down Expand Up @@ -597,13 +606,13 @@ jobs:

#Restores BYOND cache
- name: Restore BYOND cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/BYOND/*
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}

- name: Restore FlyWay cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/flyway
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }}
Expand Down Expand Up @@ -662,7 +671,7 @@ jobs:
(! grep "runtime error:" log.txt)
- name: Upload Condensed UT Log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() || ${{ runner.debug }}
with:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
Expand Down Expand Up @@ -722,13 +731,13 @@ jobs:

#Restores BYOND cache
- name: Restore BYOND cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/BYOND/*
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}

- name: Restore FlyWay cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/flyway
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }}
Expand Down Expand Up @@ -787,7 +796,7 @@ jobs:
(! grep "runtime error:" log.txt)
- name: Upload Condensed UT Log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() || ${{ runner.debug }}
with:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
Expand Down Expand Up @@ -846,13 +855,13 @@ jobs:

#Restores BYOND cache
- name: Restore BYOND cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/BYOND/*
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}

- name: Restore FlyWay cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/flyway
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }}
Expand Down Expand Up @@ -911,7 +920,7 @@ jobs:
(! grep "runtime error:" log.txt)
- name: Upload Condensed UT Log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() || ${{ runner.debug }}
with:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
Expand Down Expand Up @@ -946,7 +955,7 @@ jobs:
strategy:
matrix:
map: [runtime]
pod: [ruins]
pod: [ruins-1, ruins-2, ruins-3]
fail-fast: false

steps:
Expand All @@ -969,13 +978,13 @@ jobs:

#Restores BYOND cache
- name: Restore BYOND cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/BYOND/*
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}

- name: Restore FlyWay cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/flyway
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }}
Expand Down Expand Up @@ -1034,7 +1043,7 @@ jobs:
(! grep "runtime error:" log.txt)
- name: Upload Condensed UT Log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() || ${{ runner.debug }}
with:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
Expand Down
Loading

0 comments on commit 7d79d04

Please sign in to comment.