mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Upgrade rust_g to version 0.4.0
This commit is contained in:
2
.github/workflows/autochangelog.yml
vendored
2
.github/workflows/autochangelog.yml
vendored
@@ -11,7 +11,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
autochangelog:
|
autochangelog:
|
||||||
name: Autochangelog
|
name: Autochangelog
|
||||||
runs-on: ubuntu-16.04
|
runs-on: ubuntu-20.04
|
||||||
if: github.event.pull_request.merged == true
|
if: github.event.pull_request.merged == true
|
||||||
steps:
|
steps:
|
||||||
- uses: /actions/checkout@v2
|
- uses: /actions/checkout@v2
|
||||||
|
|||||||
64
.github/workflows/ci.yml
vendored
64
.github/workflows/ci.yml
vendored
@@ -10,7 +10,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
file_tests:
|
file_tests:
|
||||||
name: Run Linters
|
name: Run Linters
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Ensure +x on CI directory
|
- name: Ensure +x on CI directory
|
||||||
@@ -24,6 +24,7 @@ jobs:
|
|||||||
tools/ci/validate_files.sh
|
tools/ci/validate_files.sh
|
||||||
tools/ci/build_tgui.sh
|
tools/ci/build_tgui.sh
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
# dreamchecker:
|
# dreamchecker:
|
||||||
# name: DreamChecker
|
# name: DreamChecker
|
||||||
# runs-on: ubuntu-18.04
|
# runs-on: ubuntu-18.04
|
||||||
@@ -51,10 +52,67 @@ jobs:
|
|||||||
# if: always()
|
# if: always()
|
||||||
# with:
|
# with:
|
||||||
# outputFile: output-annotations.txt
|
# outputFile: output-annotations.txt
|
||||||
|
||||||| parent of 0d9f538992... Merge pull request #10869 from VOREStation/update-rust_g
|
||||||
|
dreamchecker:
|
||||||
|
name: DreamChecker
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Cache SpacemanDMM
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/SpacemanDMM
|
||||||
|
key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}}
|
||||||
|
restore-keys: ${{ runner.os }}-dreamchecker
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
tools/ci/install_spaceman_dmm.sh dreamchecker
|
||||||
|
|
||||||
|
- name: Run Linter
|
||||||
|
id: linter
|
||||||
|
run: |
|
||||||
|
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
|
||||||
|
|
||||||
|
- name: Annotate Linter
|
||||||
|
uses: yogstation13/DreamAnnotate@v1
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
outputFile: output-annotations.txt
|
||||||
|
=======
|
||||||
|
dreamchecker:
|
||||||
|
name: DreamChecker
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Cache SpacemanDMM
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/SpacemanDMM
|
||||||
|
key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}}
|
||||||
|
restore-keys: ${{ runner.os }}-dreamchecker
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
tools/ci/install_spaceman_dmm.sh dreamchecker
|
||||||
|
|
||||||
|
- name: Run Linter
|
||||||
|
id: linter
|
||||||
|
run: |
|
||||||
|
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
|
||||||
|
|
||||||
|
- name: Annotate Linter
|
||||||
|
uses: yogstation13/DreamAnnotate@v1
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
outputFile: output-annotations.txt
|
||||||
|
>>>>>>> 0d9f538992... Merge pull request #10869 from VOREStation/update-rust_g
|
||||||
|
|
||||||
unit_tests:
|
unit_tests:
|
||||||
name: Integration Tests
|
name: Integration Tests
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Ensure +x on CI directory
|
- name: Ensure +x on CI directory
|
||||||
@@ -69,7 +127,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo dpkg --add-architecture i386
|
sudo dpkg --add-architecture i386
|
||||||
sudo apt update || true
|
sudo apt update || true
|
||||||
sudo apt install libc6:i386 libgcc1:i386 libstdc++6:i386 libssl1.0.0:i386 zlib1g:i386
|
sudo apt install zlib1g-dev:i386 libssl-dev:i386 pkg-config:i386
|
||||||
ldd librust_g.so
|
ldd librust_g.so
|
||||||
- name: Unit Tests
|
- name: Unit Tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/render_nanomaps.yml
vendored
2
.github/workflows/render_nanomaps.yml
vendored
@@ -14,7 +14,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
generate_maps:
|
generate_maps:
|
||||||
name: 'Generate NanoMaps'
|
name: 'Generate NanoMaps'
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|||||||
BIN
librust_g.so
BIN
librust_g.so
Binary file not shown.
BIN
rust_g.dll
BIN
rust_g.dll
Binary file not shown.
@@ -20,14 +20,15 @@ THE SOFTWARE.
|
|||||||
import argparse, re, sys
|
import argparse, re, sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from os import path, walk
|
from os import path, walk
|
||||||
|
from codecs import open
|
||||||
|
|
||||||
opt = argparse.ArgumentParser()
|
opt = argparse.ArgumentParser()
|
||||||
opt.add_argument('dir', help='The directory to scan for *.dm files with non-matching spans')
|
opt.add_argument('dir', help='The directory to scan for *.dm files with non-matching spans')
|
||||||
args = opt.parse_args()
|
args = opt.parse_args()
|
||||||
|
|
||||||
if(not path.isdir(args.dir)):
|
if(not path.isdir(args.dir)):
|
||||||
print('Not a directory')
|
print('Not a directory')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# These tuples are expected to be ordered as:
|
# These tuples are expected to be ordered as:
|
||||||
# A unique human readable name (henceforth referred to as tuple name), a regex pattern matching an opening tag, a regex pattern matching a closing tag
|
# A unique human readable name (henceforth referred to as tuple name), a regex pattern matching an opening tag, a regex pattern matching a closing tag
|
||||||
@@ -54,13 +55,13 @@ def get_tag_matches(line):
|
|||||||
|
|
||||||
# Support def that simply checks if a given dictionary in the format tag/list of unmatched lines has mismatch entries.
|
# Support def that simply checks if a given dictionary in the format tag/list of unmatched lines has mismatch entries.
|
||||||
def has_mismatch(match_list):
|
def has_mismatch(match_list):
|
||||||
for tag, list_of_mismatched_lines in match_list.iteritems():
|
for tag, list_of_mismatched_lines in match_list.items():
|
||||||
if(len(list_of_mismatched_lines) > 0):
|
if(len(list_of_mismatched_lines) > 0):
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def arrange_mismatches(mismatches_by_tag, mismatch_line, mismatch_counts):
|
def arrange_mismatches(mismatches_by_tag, mismatch_line, mismatch_counts):
|
||||||
for tag, mismatch_count in mismatch_counts.iteritems():
|
for tag, mismatch_count in mismatch_counts.items():
|
||||||
stack_of_existing_mismatches = mismatches_by_tag[tag]
|
stack_of_existing_mismatches = mismatches_by_tag[tag]
|
||||||
for i in range(0, abs(mismatch_count)):
|
for i in range(0, abs(mismatch_count)):
|
||||||
if len(stack_of_existing_mismatches) == 0:
|
if len(stack_of_existing_mismatches) == 0:
|
||||||
@@ -83,10 +84,10 @@ def arrange_mismatches(mismatches_by_tag, mismatch_line, mismatch_counts):
|
|||||||
|
|
||||||
# This section parses all *.dm files in the given directory, recursively.
|
# This section parses all *.dm files in the given directory, recursively.
|
||||||
for root, subdirs, files in walk(args.dir):
|
for root, subdirs, files in walk(args.dir):
|
||||||
for filename in files:
|
for filename in files:
|
||||||
if filename.endswith('.dm'):
|
if filename.endswith('.dm'):
|
||||||
file_path = path.join(root, filename)
|
file_path = path.join(root, filename)
|
||||||
with open(file_path, 'r') as file:
|
with open(file_path, 'r', encoding='utf-8', errors='ignore') as file:
|
||||||
mismatches_by_file[file_path] = defaultdict(list)
|
mismatches_by_file[file_path] = defaultdict(list)
|
||||||
for line_number, line in enumerate(file, 1):
|
for line_number, line in enumerate(file, 1):
|
||||||
# Then for each line in the file, conduct the tuple open/close matching.
|
# Then for each line in the file, conduct the tuple open/close matching.
|
||||||
@@ -97,10 +98,10 @@ for root, subdirs, files in walk(args.dir):
|
|||||||
# Loops over all matches and checks if there is a mismatch of tags.
|
# Loops over all matches and checks if there is a mismatch of tags.
|
||||||
# If so, then and only then is the corresponding file path printed along with the number of unmatched open/close tags.
|
# If so, then and only then is the corresponding file path printed along with the number of unmatched open/close tags.
|
||||||
total_mismatches = 0
|
total_mismatches = 0
|
||||||
for file, mismatches_by_tag in mismatches_by_file.iteritems():
|
for file, mismatches_by_tag in mismatches_by_file.items():
|
||||||
if has_mismatch(mismatches_by_tag):
|
if has_mismatch(mismatches_by_tag):
|
||||||
print(file)
|
print(file)
|
||||||
for tag, mismatch_list in mismatches_by_tag.iteritems():
|
for tag, mismatch_list in mismatches_by_tag.items():
|
||||||
# A positive number means an excess of opening tag, a negative number means an excess of closing tags.
|
# A positive number means an excess of opening tag, a negative number means an excess of closing tags.
|
||||||
total_mismatches += len(mismatch_list)
|
total_mismatches += len(mismatch_list)
|
||||||
if len(mismatch_list) > 0:
|
if len(mismatch_list) > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user