Skip to content

Commit

Permalink
polystat#35 - fixed workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Graur committed Nov 24, 2022
1 parent 1d3ea85 commit b783a8c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 24 deletions.
50 changes: 28 additions & 22 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,31 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Pull the Docker image
run: |
mkdir out
docker pull yegor256/c2eo:0.1.24
- name: Run the Docker image
run: docker run -v $(pwd):/eo yegor256/c2eo:0.1.24 examples/hello.c out/global.eo
- name: Check out/global.eo
run: cat out/global.eo
- name: Run Polystat Jar
run: bash polystat.sh
- name: Check polystat-eo-out.txt
run: cat polystat-eo-out.txt
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: polystat-eo-out
path: polystat-eo-out.txt
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Pull the Docker image
run: |
mkdir out
docker pull yegor256/c2eo:0.1.24
- name: Copy c2o.cooperators
run: bash copy.sh
- name: Run the Docker image
run: docker run -v $(pwd):/eo yegor256/c2eo:0.1.24 examples/hello.c out/global.eo
- name: Check out/global.eo
run: |
ls -la out
cat out/global.eo
- name: Removing goto
run: bash dejump.sh
- name: Run Polystat Jar
run: bash polystat.sh
- name: Check polystat-eo-out.txt
run: cat polystat-eo-out.txt
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: polystat-eo-out
path: polystat-eo-out.txt
7 changes: 7 additions & 0 deletions copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

mkdir out/c2eo
git clone "https://github.com/polystat/c2eo.git" --branch master
ls -la
ls -la c2eo
cp -r c2eo/project/eo-lib out/c2eo
10 changes: 10 additions & 0 deletions dejump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Download Dejump jar file
curl -L -o dejump-0.0.2-jar-with-dependencies.jar "https://repo1.maven.org/maven2/org/eolang/dejump/0.0.2/dejump-0.0.2-jar-with-dependencies.jar"
echo "Dejump jar was downloaded"
java -jar dejump-0.0.2-jar-with-dependencies.jar --eo out/global.eo
echo "GOTO was removed, check the result: "
cat out/generated/global_transformed.eo
echo "Rename file"
mv out/generated/global_transformed.eo out/generated/global.eo
4 changes: 2 additions & 2 deletions examples/div-by-zero.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
auto test(int a, int b) -> int {
return (a / b) + ((b / a) / a);
int check(int x) {
return 42 / x;
}

0 comments on commit b783a8c

Please sign in to comment.