From d5b9c489ea9706bd23d83119dfae01b37cb3335c Mon Sep 17 00:00:00 2001 From: Evgeny Snitko Date: Fri, 25 Oct 2024 06:46:25 +0400 Subject: [PATCH 1/8] gha test --- .github/Dockerfile | 6 ++++++ .github/Dockerfile-llvm | 14 ++++++++++++ .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 23 ++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 .github/Dockerfile create mode 100644 .github/Dockerfile-llvm create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 00000000..4301044b --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,6 @@ +FROM revive-llvm + +WORKDIR /app + +COPY . . +RUN RUSTFLAGS='-L /app/llvm18.0/lib/unknown -L /usr/lib -L /app/llvm18.0/lib' REVIVE_INSTALL_DIR='/app/release/revive/' make install-revive \ No newline at end of file diff --git a/.github/Dockerfile-llvm b/.github/Dockerfile-llvm new file mode 100644 index 00000000..2d068130 --- /dev/null +++ b/.github/Dockerfile-llvm @@ -0,0 +1,14 @@ +FROM alpine:3.20.3 + +ARG RUST_VERSION=stable + +RUN apk add bash git cmake make g++ ninja python3 ncurses-static curl lld-dev lld lld-libs libc++-static +RUN ninja --version + +RUN bash -c ./build-llvm.sh + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION} +ENV PATH=/root/.cargo/bin:/llvm18.0/bin:${PATH} + +WORKDIR /app +RUN REVIVE_INSTALL_DIR=$(pwd)/target/release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d6f599d3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release +run-name: Release ${{ github.ref_name }} +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+" +jobs: + + CreateRelease: + permissions: + contents: write + runs-on: ubuntu-20.04 + steps: + - name: Release + uses: softprops/action-gh-release@v2 + with: + draft: true + make_latest: true + + Release: + needs: [CreateRelease] + permissions: + contents: write + runs-on: ubuntu-20.04 + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: build llvm + run: docker build -t revive-llvm:latest --progress=plain -f --build-arg RUST_VERSION=1.80 .github/Dockerfile-llvm + + - name: build revive + run: docker build -t revive:latest --progress=plain -f .github/Dockerfile + + - name: get binary + run: docker run --rm revive:latest -v output:/app/output cp /app/release/revive/resolc /app/output + + # docker push revive:latest + + - run: gh release upload ${{ github.ref_name }} output/resolc --clobber diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..f99cda0a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Release +run-name: Release ${{ github.ref_name }} +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + + Release: + runs-on: ubuntu-20.04 + steps: + - name: build llvm + run: docker build -t revive-llvm:latest --progress=plain -f --build-arg RUST_VERSION=1.80 .github/Dockerfile-llvm + + - name: build revive + run: docker build -t revive:latest --progress=plain -f .github/Dockerfile + + - name: get binary + run: docker run --rm revive:latest -v output:/app/output cp /app/release/revive/resolc /app/output + + # docker push revive:latest + + - run: gh release upload ${{ github.ref_name }} output/resolc --clobber From 7bf9d49166923ef8978451ed4f6dc264da532375 Mon Sep 17 00:00:00 2001 From: Evgeny Snitko Date: Fri, 25 Oct 2024 06:47:55 +0400 Subject: [PATCH 2/8] stop build for tests --- .github/workflows/rust.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 31006ca2..e8c78602 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,8 +3,6 @@ name: Build on: push: branches: ["main"] - pull_request: - branches: ["main"] env: CARGO_TERM_COLOR: always From a2932640283b78b742c8a48433e5b7aa0ba2a191 Mon Sep 17 00:00:00 2001 From: Evgeny Snitko Date: Fri, 25 Oct 2024 06:48:46 +0400 Subject: [PATCH 3/8] docker context --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f99cda0a..171391be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ -name: Release -run-name: Release ${{ github.ref_name }} +name: Test +run-name: Test ${{ github.ref_name }} on: pull_request: types: [opened, synchronize, reopened, ready_for_review] @@ -10,14 +10,14 @@ jobs: runs-on: ubuntu-20.04 steps: - name: build llvm - run: docker build -t revive-llvm:latest --progress=plain -f --build-arg RUST_VERSION=1.80 .github/Dockerfile-llvm + run: docker build -t revive-llvm:latest --progress=plain -f --build-arg RUST_VERSION=1.80 .github/Dockerfile-llvm . - name: build revive run: docker build -t revive:latest --progress=plain -f .github/Dockerfile - name: get binary - run: docker run --rm revive:latest -v output:/app/output cp /app/release/revive/resolc /app/output + run: docker run --rm revive:latest -v output:/app/output cp /app/release/revive/resolc /app/output . # docker push revive:latest - - run: gh release upload ${{ github.ref_name }} output/resolc --clobber + - run: gh release upload ${{ github.ref_name }} output/resolc From 76f815f33b1f545c0e9fdeb015f62d0c01649b22 Mon Sep 17 00:00:00 2001 From: Evgeny Snitko Date: Fri, 25 Oct 2024 06:50:24 +0400 Subject: [PATCH 4/8] -f --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 171391be..1b1eeb8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: build llvm - run: docker build -t revive-llvm:latest --progress=plain -f --build-arg RUST_VERSION=1.80 .github/Dockerfile-llvm . + run: docker build -t revive-llvm:latest --progress=plain --build-arg RUST_VERSION=1.80 -f .github/Dockerfile-llvm . - name: build revive run: docker build -t revive:latest --progress=plain -f .github/Dockerfile From fdc44db1be3b96ec371f5d824d9a0e3eddd300ac Mon Sep 17 00:00:00 2001 From: Evgeny Snitko Date: Fri, 25 Oct 2024 06:51:58 +0400 Subject: [PATCH 5/8] checkout --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b1eeb8a..d4e1a2cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,10 @@ jobs: Release: runs-on: ubuntu-20.04 steps: + + - name: Checkout repository + uses: actions/checkout@v4 + - name: build llvm run: docker build -t revive-llvm:latest --progress=plain --build-arg RUST_VERSION=1.80 -f .github/Dockerfile-llvm . From 33d589ea7f8c8116a4da3d8733c29caeb08166a0 Mon Sep 17 00:00:00 2001 From: Evgeny Snitko Date: Fri, 25 Oct 2024 06:55:30 +0400 Subject: [PATCH 6/8] COPY build-llvm.sh --- .github/Dockerfile-llvm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/Dockerfile-llvm b/.github/Dockerfile-llvm index 2d068130..17b5457c 100644 --- a/.github/Dockerfile-llvm +++ b/.github/Dockerfile-llvm @@ -5,6 +5,8 @@ ARG RUST_VERSION=stable RUN apk add bash git cmake make g++ ninja python3 ncurses-static curl lld-dev lld lld-libs libc++-static RUN ninja --version +COPY build-llvm.sh . + RUN bash -c ./build-llvm.sh RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION} From 36f9345c22b44936b3048d2ef58f43506a902bab Mon Sep 17 00:00:00 2001 From: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:49:13 +0200 Subject: [PATCH 7/8] Update .github/Dockerfile-llvm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- .github/Dockerfile-llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Dockerfile-llvm b/.github/Dockerfile-llvm index 17b5457c..32d4b837 100644 --- a/.github/Dockerfile-llvm +++ b/.github/Dockerfile-llvm @@ -2,7 +2,7 @@ FROM alpine:3.20.3 ARG RUST_VERSION=stable -RUN apk add bash git cmake make g++ ninja python3 ncurses-static curl lld-dev lld lld-libs libc++-static +RUN apk add bash git cmake make ninja python3 ncurses-static curl RUN ninja --version COPY build-llvm.sh . From 199b6145f2f2af119534359a72c144a3928cf9fc Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Oct 2024 09:51:09 +0200 Subject: [PATCH 8/8] try parity runner --- .github/workflows/test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d4e1a2cf..2f39588d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,14 +2,17 @@ name: Test run-name: Test ${{ github.ref_name }} on: pull_request: - types: [opened, synchronize, reopened, ready_for_review] + types: [opened, synchronize, reopened, ready_for_review] -jobs: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: Release: - runs-on: ubuntu-20.04 + # runs-on: ubuntu-20.04 + runs-on: parity-large steps: - - name: Checkout repository uses: actions/checkout@v4