Skip to content

Commit

Permalink
Merge branch 'master' into 2313_Universe
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed Aug 13, 2023
2 parents d31bd7a + 101207c commit 1493413
Show file tree
Hide file tree
Showing 102 changed files with 2,901 additions and 686 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true
jobs:
codecov:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ on:
- cron: '30 1 * * *'
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-jdk-${{ matrix.java }}-maven-
- run: |
# Clean the test classes to avoid caching issues and prepare testing environment
# without running the tests
mvn clean install -Pqulice -DskipTests -DskipITs -Dinvoker.skip=true
# Find script
SCRIPT="${GITHUB_WORKSPACE}/src/test/scripts/test-repetition.sh"
# Check that script is exists
if [ ! -f "${SCRIPT}" ]; then
Expand All @@ -22,7 +32,7 @@ jobs:
# Test eo-maven-plugin
${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-maven-plugin
# Test eo-runtime
${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-runtime
${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-runtime --compilation true
# @todo #2085:90min Add GitHub action step to create an issue.
# It would be convenient to add github action step that will create an
# issue in case of any of the tests is failed. We can do it through
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ebnf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true
jobs:
ebnf:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
CONVERT_PATH: /tmp/antlr4-to-bnf-converter
steps:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/gpt-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: GPT-code-review
on:
pull_request:
branches: [master]
permissions:
pull-requests: write
contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install code-review-gpt
- run: npx code-review-gpt review --ci=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_SHA: ${{ github.sha }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
23 changes: 19 additions & 4 deletions .github/workflows/mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches:
- master
paths-ignore: ['paper/**', 'sandbox/**']
paths-ignore: [ 'paper/**', 'sandbox/**' ]
pull_request:
branches:
- master
paths-ignore: ['paper/**', 'sandbox/**']
paths-ignore: [ 'paper/**', 'sandbox/**' ]
concurrency:
group: mvn-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -17,8 +17,8 @@ jobs:
name: mvn
strategy:
matrix:
os: [ubuntu-20.04, windows-2022, macos-12]
java: [11, 20]
os: [ ubuntu-20.04, windows-2022, macos-12 ]
java: [ 11, 20 ]
runs-on: ${{ matrix.os }}
env:
CONVERT_PATH: /tmp/antlr4-to-bnf-converter
Expand All @@ -33,6 +33,21 @@ jobs:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-
# The next step is required to avoid some exceptions that occur
# when running on Windows OS. For example like this one:
# - https://github.com/objectionary/eo/issues/2336
# The step disables http multiplexing in Cargo which cause some problems
# on Windows OS.
# You can read more about multiplexing right here
# - https://stackoverflow.com/questions/36517829/what-does-multiplexing-mean-in-http-2
# Multiplexing in Rust:
# - https://doc.rust-lang.org/cargo/reference/config.html#httpmultiplexing
- name: Set Cargo config (Windows)
if: matrix.os == 'windows-2022'
run: |
echo [http] >> %USERPROFILE%\.cargo\config.toml
echo multiplexing = false >> %USERPROFILE%\.cargo\config.toml
shell: cmd
- run: |
mkdir -p $CONVERT_PATH
wget --quiet http://public.yegor256.com/convert.zip -O /tmp/convert.zip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pdd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true
jobs:
pdd:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: g4s8/pdd-action@master
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true
jobs:
sonar:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true
jobs:
up:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/xcop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true
jobs:
xcop:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: g4s8/xcop-action@v1.3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/year.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ concurrency:
cancel-in-progress: true
jobs:
license:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions eo-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ create a file `pom.xml` with this content (it's just a sample):
<plugin>
<groupId>org.eolang</groupId>
<artifactId>eo-maven-plugin</artifactId>
<version>0.29.6</version>
<version>0.30.0</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -140,7 +140,7 @@ This can be achived by disabling `maven-invoker-plugin` execution within `eo-mav
...
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>0.29.6</version>
<version>0.30.0</version>
<configuration>
<skipInstallation>true</skipInstallation>
<skipInvocation>true</skipInvocation>
Expand Down
9 changes: 4 additions & 5 deletions eo-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SOFTWARE.
<groupId>org.eolang</groupId>
<artifactId>eo-runtime</artifactId>
<!-- This version is intentionally lower than the current version of the project -->
<version>0.29.6</version>
<version>0.30.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -93,7 +93,7 @@ SOFTWARE.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.3</version>
<version>3.9.4</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -123,7 +123,7 @@ SOFTWARE.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.9.3</version>
<version>3.9.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -204,7 +204,7 @@ SOFTWARE.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<version>3.13.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -263,7 +263,6 @@ SOFTWARE.
<excludedGroups>slow</excludedGroups>
<argLine>@{argLine} -Xss${stack-size}</argLine>
<systemPropertyVariables>
<runtime.jar>${org.eolang:eo-runtime:jar}</runtime.jar>
<runtime.path>${project.basedir}/../eo-runtime</runtime.path>
</systemPropertyVariables>
<properties>
Expand Down
20 changes: 15 additions & 5 deletions eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.eolang.maven.objectionary.Objectionary;
import org.eolang.maven.objectionary.Objectionaries;
import org.eolang.maven.objectionary.ObjsDefault;

/**
* Pull all necessary EO XML files from Objectionary and parse them all.
Expand Down Expand Up @@ -65,10 +66,14 @@ public final class AssembleMojo extends SafeMojo {
private File outputDir;

/**
* The objectionary.
* Objectionaries.
* @checkstyle MemberNameCheck (6 lines)
* @checkstyle ConstantUsageCheck (5 lines)
*/
@SuppressWarnings("PMD.ImmutableField")
private Objectionary objectionary;
private final Objectionaries objectionaries = new ObjsDefault(
() -> this.cache,
() -> this.session.getRequest().isUpdateSnapshots()
);

/**
* The central.
Expand All @@ -85,8 +90,13 @@ public final class AssembleMojo extends SafeMojo {
private boolean overWrite;

/**
* The Git hash to pull objects from, in objectionary.
* The Git tag to pull objects from, in objectionary.
* @since 0.21.0
* @todo #2302:30min Rename the parameter "hash". This parameter is actually
* a tag, not a hash. By this tag application actually finds hash and then
* uses it. So need to rename this parameter to "tag" and rename it in all
* places where it's used. Also it would be better to use name "hash" for
* parameter "hsh" in {@link ProbeMojo} and {@link PullMojo}
*/
@SuppressWarnings("PMD.ImmutableField")
@Parameter(property = "eo.hash", required = true, defaultValue = "master")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.cactoos.map.MapOf;
import org.eolang.maven.footprint.FtDefault;
import org.eolang.maven.rust.Commented;
import org.eolang.maven.rust.Module;
import org.eolang.maven.rust.Names;
import org.eolang.maven.rust.Native;
Expand Down Expand Up @@ -159,14 +160,15 @@ public void exec() throws IOException {
input.xpath("/program/@name").get(0)
);
new Project(this.targetDir.toPath().resolve("Lib/".concat(function)))
.with(new Module(code, "foo"), dependencies)
.with(new PrimeModule(function, "lib"), new ArrayList<>(1))
.with(new Module(code, "src/foo"), dependencies)
.with(new PrimeModule(function, "src/lib"), new ArrayList<>(1))
.dependency(
"eo_env",
new MapOf<>("path", this.eoEnvDir.getAbsolutePath())
)
.save();
new Native(function, "EOrust.natives").save(
new Commented(new Native(function, "EOrust.natives"), "//")
.save(
new FtDefault(
this.generatedDir.toPath().resolve("EOrust").resolve("natives")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
/**
* A piece of text generated in runtime, to be injected into the files
* that we generate as output, for example .java and .sodg files.
*
* @since 0.27
*/
final class Disclaimer {
public final class Disclaimer {

@Override
public String toString() {
Expand Down
30 changes: 19 additions & 11 deletions eo-maven-plugin/src/main/java/org/eolang/maven/DiscoverMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import org.apache.maven.plugins.annotations.Mojo;
import org.cactoos.iterable.Filtered;
import org.cactoos.set.SetOf;
import org.eolang.maven.name.ObjectName;
import org.eolang.maven.name.OnVersioned;
import org.eolang.maven.tojos.ForeignTojo;
import org.eolang.maven.util.Rel;

Expand All @@ -54,15 +56,19 @@ public final class DiscoverMojo extends SafeMojo {
@Override
public void exec() throws FileNotFoundException {
final Collection<ForeignTojo> tojos = this.scopedTojos().notDiscovered();
final Collection<String> discovered = new HashSet<>(1);
final Collection<ObjectName> discovered = new HashSet<>(1);
for (final ForeignTojo tojo : tojos) {
final Path src = tojo.optimized();
tojo.withDiscovered(
(int) this.discover(src)
.stream()
.filter(name -> !name.isEmpty())
.peek(name -> this.scopedTojos().add(name).withDiscoveredAt(src))
.peek(discovered::add)
.map(OnVersioned::new)
.peek(
name -> this.scopedTojos()
.add(name)
.withDiscoveredAt(src)
).peek(discovered::add)
.count()
);
}
Expand Down Expand Up @@ -112,7 +118,7 @@ private Collection<String> discover(final Path file) {
}

/**
* Get unique list of object names from given XML.
* Get a unique list of object names from given XML.
* @param xml XML.
* @return Object names.
*/
Expand All @@ -122,15 +128,17 @@ private static Set<String> names(final XML xml) {
obj -> !obj.isEmpty(),
xml.xpath(
String.join(
" ",
"",
"//o[",
"not(starts-with(@base,'.'))",
"and @base != 'Q'",
"and @base != '^'",
"and @base != '$'",
"and @base != '&'",
"and not(@ref)",
"]/string-join((@base, @ver),'|')"
" and @base != 'Q'",
" and @base != '^'",
" and @base != '$'",
" and @base != '&'",
" and not(@ref)",
"]/string-join((@base, @ver),'",
OnVersioned.DELIMITER,
"')"
)
)
)
Expand Down
Loading

0 comments on commit 1493413

Please sign in to comment.