diff --git a/.github/workflows/clang-tests.yml b/.github/workflows/clang-tests.yml index ef416dce55e7..205819aee1a5 100644 --- a/.github/workflows/clang-tests.yml +++ b/.github/workflows/clang-tests.yml @@ -1,6 +1,7 @@ name: Clang Tests on: + workflow_dispatch: push: branches: - 'release/**' @@ -27,7 +28,7 @@ concurrency: jobs: check_clang: name: Test clang,lldb,libclc - uses: OpenCilk/opencilk-project/.github/workflows/llvm-project-tests.yml@release/14.x + uses: ./.github/workflows/llvm-project-tests.yml with: build_target: check-clang projects: clang;lldb;libclc diff --git a/.github/workflows/closed-issues.yml b/.github/workflows/closed-issues.yml index dba8503d5778..921bbcf786bf 100644 --- a/.github/workflows/closed-issues.yml +++ b/.github/workflows/closed-issues.yml @@ -10,4 +10,4 @@ jobs: steps: - uses: andymckay/labeler@1.0.4 with: - remove-labels: "awaiting-review" \ No newline at end of file + remove-labels: 'awaiting-review' diff --git a/.github/workflows/issue-release-workflow.yml b/.github/workflows/issue-release-workflow.yml index 432f06d1586b..927ffb8ae550 100644 --- a/.github/workflows/issue-release-workflow.yml +++ b/.github/workflows/issue-release-workflow.yml @@ -4,7 +4,7 @@ # /cherry-pick <...> # # This comment will attempt to cherry-pick the given commits to the latest -# release branch (release/Y.x) and if successful push the result to a branch +# release branch (release/Y.x) and if successful, push the result to a branch # on github. # # /branch // @@ -19,23 +19,30 @@ on: types: - created - edited + issues: + types: + - opened env: - COMMENT_BODY: ${{ github.event.comment.body }} + COMMENT_BODY: ${{ github.event.action == 'opened' && github.event.issue.body || github.event.comment.body }} jobs: backport-commits: name: Backport Commits runs-on: ubuntu-20.04 if: >- - (github.repository == 'llvm/llvm-project') && - !startswith(github.event.comment.body, '') && - contains(github.event.comment.body, '/cherry-pick') + (github.repository == 'llvm/llvm-project') && + !startswith(github.event.comment.body, '') && + contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick') steps: - name: Fetch LLVM sources uses: actions/checkout@v2 with: repository: llvm/llvm-project + # GitHub stores the token used for checkout and uses it for pushes + # too, but we want to use a different token for pushing, so we need + # to disable persist-credentials here. + persist-credentials: false fetch-depth: 0 - name: Setup Environment @@ -51,22 +58,23 @@ jobs: --token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \ release-workflow \ --issue-number ${{ github.event.issue.number }} \ + --phab-token ${{ secrets.RELEASE_WORKFLOW_PHAB_TOKEN }} \ auto create-pull-request: name: Create Pull Request runs-on: ubuntu-20.04 if: >- - (github.repository == 'llvm/llvm-project') && - !startswith(github.event.comment.body, '') && - contains(github.event.comment.body, '/branch') + (github.repository == 'llvm/llvm-project') && + !startswith(github.event.comment.body, '') && + contains(github.event.comment.body, '/branch') steps: - name: Fetch LLVM sources uses: actions/checkout@v2 - name: Setup Environment - run: | + run: | pip install -r ./llvm/utils/git/requirements.txt - name: Create Pull Request diff --git a/.github/workflows/issue-subscriber.yml b/.github/workflows/issue-subscriber.yml index af904c0f26bf..a243c7526814 100644 --- a/.github/workflows/issue-subscriber.yml +++ b/.github/workflows/issue-subscriber.yml @@ -10,16 +10,20 @@ jobs: runs-on: ubuntu-latest if: github.repository == 'llvm/llvm-project' steps: - - name: Setup Automation Script - run: | - curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/github-automation.py - chmod a+x github-automation.py - pip install PyGithub + - name: Setup Automation Script + run: | + curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/github-automation.py + curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/requirements.txt + chmod a+x github-automation.py + pip install -r requirements.txt - - name: Update watchers - run: | - ./github-automation.py \ - --token ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }} \ - issue-subscriber \ - --issue-number ${{ github.event.issue.number }} \ - --label-name ${{ github.event.label.name }} + - name: Update watchers + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + env: + LABEL_NAME: ${{ github.event.label.name }} + run: | + ./github-automation.py \ + --token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \ + issue-subscriber \ + --issue-number '${{ github.event.issue.number }}' \ + --label-name "$LABEL_NAME" diff --git a/.github/workflows/libclang-abi-tests.yml b/.github/workflows/libclang-abi-tests.yml index c9b4876c39fb..8f3b9bd1692a 100644 --- a/.github/workflows/libclang-abi-tests.yml +++ b/.github/workflows/libclang-abi-tests.yml @@ -3,16 +3,21 @@ name: libclang ABI Tests # TODO: Enable this test based on OpenCilk Clang changes. on: + workflow_dispatch: push: + ignore-forks: true branches: - - 'nobranch/**' + - 'release/**' + paths: + - 'clang/**' + - '.github/workflows/libclang-abi-tests.yml' + pull_request: + ignore-forks: true + branches: + - 'release/**' paths: - 'clang/**' - '.github/workflows/libclang-abi-tests.yml' -# pull_request: -# paths: -# - 'clang/**' -# - '.github/workflows/libclang-abi-tests.yml' concurrency: # Skip intermediate builds: always. @@ -23,6 +28,7 @@ concurrency: jobs: abi-dump-setup: + if: github.repository_owner == 'llvm' runs-on: ubuntu-latest outputs: BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} @@ -35,7 +41,7 @@ jobs: LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }} steps: - name: Checkout source - uses: actions/checkout@v1 + uses: actions/checkout@v3 with: fetch-depth: 250 @@ -76,6 +82,7 @@ jobs: abi-dump: + if: github.repository_owner == 'llvm' needs: abi-dump-setup runs-on: ubuntu-latest strategy: @@ -119,12 +126,10 @@ jobs: - name: Dump ABI run: | parallel abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o {}-${{ matrix.ref }}.abi ./build/lib/{} ::: ${{ needs.abi-dump-setup.outputs.ABI_LIBS }} - # Remove symbol versioning from dumps, so we can compare across major - # versions. We don't need to do this for libclang.so since its ABI - # is stable across major releases and the symbol versions don't change. - if [ -e libclang-cpp.so-${{ matrix.ref }}.abi ]; then - sed -i 's/LLVM_[0-9]\+/LLVM_NOVERSION/' libclang-cpp.so-${{ matrix.ref }}.abi - fi + for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do + # Remove symbol versioning from dumps, so we can compare across major versions. + sed -i 's/LLVM_[0-9]\+/LLVM_NOVERSION/' $lib-${{ matrix.ref }}.abi + done - name: Upload ABI file uses: actions/upload-artifact@v2 with: @@ -132,6 +137,7 @@ jobs: path: "*${{ matrix.ref }}.abi" abi-compare: + if: github.repository_owner == 'llvm' runs-on: ubuntu-latest needs: - abi-dump-setup diff --git a/.github/workflows/libclc-tests.yml b/.github/workflows/libclc-tests.yml index cc4558a730c8..d9bc1d0bc413 100644 --- a/.github/workflows/libclc-tests.yml +++ b/.github/workflows/libclc-tests.yml @@ -1,6 +1,7 @@ name: libclc Tests on: + workflow_dispatch: push: branches: - 'release/**' @@ -27,7 +28,7 @@ concurrency: jobs: check_libclc: name: Test libclc - uses: OpenCilk/opencilk-project/.github/workflows/llvm-project-tests.yml@release/14.x + uses: ./.github/workflows/llvm-project-tests.yml with: build_target: '' projects: clang;libclc diff --git a/.github/workflows/lld-tests.yml b/.github/workflows/lld-tests.yml index 5d6180eb152d..122babf27c8b 100644 --- a/.github/workflows/lld-tests.yml +++ b/.github/workflows/lld-tests.yml @@ -27,7 +27,7 @@ concurrency: jobs: check_lld: name: Test lld - uses: OpenCilk/opencilk-project/.github/workflows/llvm-project-tests.yml@release/14.x + uses: ./.github/workflows/llvm-project-tests.yml with: build_target: check-lld projects: lld diff --git a/.github/workflows/lldb-tests.yml b/.github/workflows/lldb-tests.yml index 457b099c5970..2db070db85b7 100644 --- a/.github/workflows/lldb-tests.yml +++ b/.github/workflows/lldb-tests.yml @@ -1,6 +1,7 @@ name: lldb Tests on: + workflow_dispatch: push: branches: - 'release/**' @@ -28,7 +29,7 @@ concurrency: jobs: build_lldb: name: Build lldb - uses: OpenCilk/opencilk-project/.github/workflows/llvm-project-tests.yml@release/14.x + uses: ./.github/workflows/llvm-project-tests.yml with: build_target: '' projects: clang;lldb diff --git a/.github/workflows/llvm-bugs.yml b/.github/workflows/llvm-bugs.yml index e7f242e9c01e..c45264160605 100644 --- a/.github/workflows/llvm-bugs.yml +++ b/.github/workflows/llvm-bugs.yml @@ -8,7 +8,7 @@ on: jobs: auto-subscribe: runs-on: ubuntu-latest - if: github.repository == 'llvm/llvm-project' + if: github.repository_owner == 'llvm' steps: - uses: actions/setup-node@v2 with: @@ -20,38 +20,39 @@ jobs: MAILGUN_API_KEY: ${{ secrets.LLVM_BUGS_KEY }} with: script: | - const Mailgun = require("mailgun.js"); + const Mailgun = require('mailgun.js'); const formData = require('form-data'); - const mailgun = new Mailgun(formData); - const DOMAIN = "email.llvm.org"; + const mailgun = new Mailgun(formData); + const DOMAIN = 'email.llvm.org'; - const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY}); + const mg = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY }); github.rest.issues.get({ issue_number: context.issue.number, owner: context.repo.owner, - repo: context.repo.repo, + repo: context.repo.repo }) - .then(function(issue) { + .then((issue) => { const payload = { author : issue.data.user.login, issue : issue.data.number, title : issue.data.title, url : issue.data.html_url, - labels : issue.data.labels.map(label => { return label.name }), - assignee : issue.data.assignees.map(assignee => { return assignee.login }), + labels : issue.data.labels.map((label) => label.name), + assignee : issue.data.assignees.map((assignee) => assignee.login), body : issue.data.body }; - + const data = { - from: "LLVM Bugs ", - to: "llvm-bugs@lists.llvm.org", + from: 'LLVM Bugs ', + to: 'llvm-bugs@lists.llvm.org', subject: `[Bug ${issue.data.number}] ${issue.data.title}`, - template: "new-github-issue", + template: 'new-github-issue', + 'o:tracking-clicks': 'no', 'h:X-Mailgun-Variables': JSON.stringify(payload) }; - return mg.messages.create(DOMAIN, data) + return mg.messages.create(DOMAIN, data); }) - .then(msg => console.log(msg)); + .then((msg) => console.log(msg)); diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml index c8bbdde20eef..a61de541f430 100644 --- a/.github/workflows/llvm-project-tests.yml +++ b/.github/workflows/llvm-project-tests.yml @@ -25,15 +25,10 @@ concurrency: group: llvm-project-${{ github.workflow }}-${{ inputs.projects}}${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} -# env: -# # Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274 -# CPLUS_INCLUDE_PATH: /usr/local/Cellar/llvm/14.0.6/include/c++/v1:/usr/local/Cellar/llvm@13/13.0.1/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include - env: # Workaround for https://github.com/actions/virtual-environments/issues/5900. # This should be a no-op for non-mac OSes CPLUS_INCLUDE_PATH: /usr/local/Cellar/llvm/14.0.6_1/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include - # PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//11 jobs: lit-tests: diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml index 212f4e932699..2aa2a1a25b3f 100644 --- a/.github/workflows/llvm-tests.yml +++ b/.github/workflows/llvm-tests.yml @@ -1,6 +1,7 @@ name: LLVM Tests on: + workflow_dispatch: push: branches: - 'release/**' @@ -26,7 +27,7 @@ concurrency: jobs: check_all: name: Test llvm,clang,libclc - uses: OpenCilk/opencilk-project/.github/workflows/llvm-project-tests.yml@release/14.x + uses: ./.github/workflows/llvm-project-tests.yml with: build_target: check-all projects: clang;libclc @@ -35,152 +36,155 @@ jobs: # space to build all these projects on Windows. build_lldb: name: Build lldb - uses: OpenCilk/opencilk-project/.github/workflows/llvm-project-tests.yml@release/14.x + uses: ./.github/workflows/llvm-project-tests.yml with: build_target: '' projects: clang;lldb check_lld: name: Test lld - uses: OpenCilk/opencilk-project/.github/workflows/llvm-project-tests.yml@release/14.x + uses: ./.github/workflows/llvm-project-tests.yml with: build_target: check-lld projects: lld - # abi-dump-setup: - # runs-on: ubuntu-latest - # outputs: - # BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} - # ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }} - # BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }} - # LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - # LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }} - # LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }} - # steps: - # - name: Checkout source - # uses: actions/checkout@v1 - # with: - # fetch-depth: 250 + abi-dump-setup: + if: github.repository_owner == 'llvm' + runs-on: ubuntu-latest + outputs: + BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} + ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }} + BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }} + LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} + LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }} + LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }} + steps: + - name: Checkout source + uses: actions/checkout@v3 + with: + fetch-depth: 250 - # - name: Get LLVM version - # id: version - # uses: llvm/actions/get-llvm-version@main + - name: Get LLVM version + id: version + uses: llvm/actions/get-llvm-version@main - # - name: Setup Variables - # id: vars - # run: | - # if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 -o ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then - # echo ::set-output name=BASELINE_VERSION_MAJOR::$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1)) - # echo ::set-output name=ABI_HEADERS::llvm-c - # else - # echo ::set-output name=BASELINE_VERSION_MAJOR::${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - # echo ::set-output name=ABI_HEADERS::. - # fi + - name: Setup Variables + id: vars + run: | + if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 -o ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then + echo ::set-output name=BASELINE_VERSION_MAJOR::$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1)) + echo ::set-output name=ABI_HEADERS::llvm-c + else + echo ::set-output name=BASELINE_VERSION_MAJOR::${{ steps.version.outputs.LLVM_VERSION_MAJOR }} + echo ::set-output name=ABI_HEADERS::. + fi - # abi-dump: - # needs: abi-dump-setup - # runs-on: ubuntu-latest - # strategy: - # matrix: - # name: - # - build-baseline - # - build-latest - # include: - # - name: build-baseline - # llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }} - # ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.0.0 - # repo: llvm/llvm-project - # - name: build-latest - # llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }} - # ref: ${{ github.sha }} - # repo: ${{ github.repository }} - # steps: - # - name: Install Ninja - # uses: llvm/actions/install-ninja@main - # - name: Install abi-compliance-checker - # run: | - # sudo apt-get install abi-dumper autoconf pkg-config - # - name: Install universal-ctags - # run: | - # git clone https://github.com/universal-ctags/ctags.git - # cd ctags - # ./autogen.sh - # ./configure - # sudo make install - # - name: Download source code - # uses: llvm/actions/get-llvm-project-src@main - # with: - # ref: ${{ matrix.ref }} - # repo: ${{ matrix.repo }} - # - name: Configure - # run: | - # mkdir install - # cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g1 -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g1 -Og" -DCMAKE_INSTALL_PREFIX=`pwd`/install llvm - # - name: Build - # # Need to run install-LLVM twice to ensure the symlink is installed (this is a bug). - # run: | - # ninja -C build install-LLVM - # ninja -C build install-LLVM - # ninja -C build install-llvm-headers - # - name: Dump ABI - # run: | - # if [ "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" ]; then - # nm ./install/lib/libLLVM.so | awk "/T _LLVM/ || /T LLVM/ { print $3 }" | sort -u | sed -e "s/^_//g" | cut -d ' ' -f 3 > llvm.symbols - # # Even though the -symbols-list option doesn't seem to filter out the symbols, I believe it speeds up processing, so I'm leaving it in. - # export EXTRA_ARGS="-symbols-list llvm.symbols" - # else - # touch llvm.symbols - # fi - # abi-dumper $EXTRA_ARGS -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o ${{ matrix.ref }}.abi ./install/lib/libLLVM.so - # # Remove symbol versioning from dumps, so we can compare across major versions. - # sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi - # - name: Upload ABI file - # uses: actions/upload-artifact@v1 - # with: - # name: ${{ matrix.name }} - # path: ${{ matrix.ref }}.abi + abi-dump: + if: github.repository_owner == 'llvm' + needs: abi-dump-setup + runs-on: ubuntu-latest + strategy: + matrix: + name: + - build-baseline + - build-latest + include: + - name: build-baseline + llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }} + ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.0.0 + repo: llvm/llvm-project + - name: build-latest + llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }} + ref: ${{ github.sha }} + repo: ${{ github.repository }} + steps: + - name: Install Ninja + uses: llvm/actions/install-ninja@main + - name: Install abi-compliance-checker + run: | + sudo apt-get install abi-dumper autoconf pkg-config + - name: Install universal-ctags + run: | + git clone https://github.com/universal-ctags/ctags.git + cd ctags + ./autogen.sh + ./configure + sudo make install + - name: Download source code + uses: llvm/actions/get-llvm-project-src@main + with: + ref: ${{ matrix.ref }} + repo: ${{ matrix.repo }} + - name: Configure + run: | + mkdir install + cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g1 -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g1 -Og" -DCMAKE_INSTALL_PREFIX=`pwd`/install llvm + - name: Build + # Need to run install-LLVM twice to ensure the symlink is installed (this is a bug). + run: | + ninja -C build install-LLVM + ninja -C build install-LLVM + ninja -C build install-llvm-headers + - name: Dump ABI + run: | + if [ "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" ]; then + nm ./install/lib/libLLVM.so | awk "/T _LLVM/ || /T LLVM/ { print $3 }" | sort -u | sed -e "s/^_//g" | cut -d ' ' -f 3 > llvm.symbols + # Even though the -symbols-list option doesn't seem to filter out the symbols, I believe it speeds up processing, so I'm leaving it in. + export EXTRA_ARGS="-symbols-list llvm.symbols" + else + touch llvm.symbols + fi + abi-dumper $EXTRA_ARGS -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o ${{ matrix.ref }}.abi ./install/lib/libLLVM.so + # Remove symbol versioning from dumps, so we can compare across major versions. + sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi + - name: Upload ABI file + uses: actions/upload-artifact@v1 + with: + name: ${{ matrix.name }} + path: ${{ matrix.ref }}.abi - # - name: Upload symbol list file - # if: matrix.name == 'build-baseline' - # uses: actions/upload-artifact@v1 - # with: - # name: symbol-list - # path: llvm.symbols + - name: Upload symbol list file + if: matrix.name == 'build-baseline' + uses: actions/upload-artifact@v1 + with: + name: symbol-list + path: llvm.symbols - # abi-compare: - # runs-on: ubuntu-latest - # needs: - # - abi-dump-setup - # - abi-dump - # steps: - # - name: Download baseline - # uses: actions/download-artifact@v1 - # with: - # name: build-baseline - # - name: Download latest - # uses: actions/download-artifact@v1 - # with: - # name: build-latest - # - name: Download symbol list - # uses: actions/download-artifact@v1 - # with: - # name: symbol-list + abi-compare: + if: github.repository_owner == 'llvm' + runs-on: ubuntu-latest + needs: + - abi-dump-setup + - abi-dump + steps: + - name: Download baseline + uses: actions/download-artifact@v1 + with: + name: build-baseline + - name: Download latest + uses: actions/download-artifact@v1 + with: + name: build-latest + - name: Download symbol list + uses: actions/download-artifact@v1 + with: + name: symbol-list - # - name: Install abi-compliance-checker - # run: sudo apt-get install abi-compliance-checker - # - name: Compare ABI - # run: | - # if [ -s symbol-list/llvm.symbols ]; then - # # This option doesn't seem to work with the ABI dumper, so passing it here. - # export EXTRA_ARGS="-symbols-list symbol-list/llvm.symbols" - # fi - # # FIXME: Reading of gzip'd abi files on the GitHub runners stop - # # working some time in March of 2021, likely due to a change in the - # # runner's environment. - # abi-compliance-checker $EXTRA_ARGS -l libLLVM.so -old build-baseline/*.abi -new build-latest/*.abi || test "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" - # - name: Upload ABI Comparison - # if: always() - # uses: actions/upload-artifact@v1 - # with: - # name: compat-report-${{ github.sha }} - # path: compat_reports/ + - name: Install abi-compliance-checker + run: sudo apt-get install abi-compliance-checker + - name: Compare ABI + run: | + if [ -s symbol-list/llvm.symbols ]; then + # This option doesn't seem to work with the ABI dumper, so passing it here. + export EXTRA_ARGS="-symbols-list symbol-list/llvm.symbols" + fi + # FIXME: Reading of gzip'd abi files on the GitHub runners stop + # working some time in March of 2021, likely due to a change in the + # runner's environment. + abi-compliance-checker $EXTRA_ARGS -l libLLVM.so -old build-baseline/*.abi -new build-latest/*.abi || test "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" + - name: Upload ABI Comparison + if: always() + uses: actions/upload-artifact@v1 + with: + name: compat-report-${{ github.sha }} + path: compat_reports/ diff --git a/.github/workflows/new-issues.yml b/.github/workflows/new-issues.yml index 5a8e79ba8874..97dfc54a7b13 100644 --- a/.github/workflows/new-issues.yml +++ b/.github/workflows/new-issues.yml @@ -10,5 +10,5 @@ jobs: steps: - uses: andymckay/labeler@1.0.4 with: - add-labels: "new issue" + add-labels: 'new issue' ignore-if-labeled: true diff --git a/.github/workflows/release-tasks.yml b/.github/workflows/release-tasks.yml new file mode 100644 index 000000000000..a87805b87860 --- /dev/null +++ b/.github/workflows/release-tasks.yml @@ -0,0 +1,66 @@ +name: Release Task + +on: + push: + tags: + # The regex support here is limited, so just match everything that starts with llvmorg- and filter later. + - 'llvmorg-*' + +jobs: + release-tasks: + runs-on: ubuntu-latest + if: github.repository == 'llvm/llvm-project' + steps: + + - name: Validate Tag + id: validate-tag + run: | + test "${{ github.actor }}" = "tstellar" + echo "${{ github.ref_name }}" | grep -e '^llvmorg-[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\)\?$' + release_version=`echo "${{ github.ref_name }}" | sed 's/llvmorg-//g'` + echo "::set-output name=release-version::$release_version" + + - name: Install Dependencies + run: | + sudo apt-get install -y \ + doxygen \ + graphviz \ + python3-github \ + python3-recommonmark \ + python3-sphinx \ + ninja-build \ + texlive-font-utils + pip3 install --user sphinx-markdown-tables + + - name: Checkout LLVM + uses: actions/checkout@v3 + + - name: Create Release + run: | + ./llvm/utils/release/./github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} create + + - name: Build Documentation + run: | + ./llvm/utils/release/build-docs.sh -srcdir llvm + ./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files *doxygen*.tar.xz + + - name: Clone www-releases + if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }} + uses: actions/checkout@v3 + with: + repository: ${{ github.repository_owner }}/www-releases + ref: main + fetch-depth: 0 + path: www-releases + + - name: Upload Release Notes + if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }} + run: | + mkdir -p ../www-releases/${{ steps.validate-tag.outputs.release-version }} + mv ./docs-build/html-export/* ../www-releases/${{ steps.validate-tag.outputs.release-version }} + cd ../www-releases + git add ${{ steps.validate-tag.outputs.release-version }} + git config user.email "llvmbot@llvm.org" + git config user.name "llvmbot" + git commit -a -m "Add ${{ steps.validate-tag.outputs.release-version }} documentation" + git push https://${{ secrets.WWW_RELEASES_TOKEN }}@github.com/${{ github.repository_owner }}/www-releases main:main diff --git a/.github/workflows/version-check.py b/.github/workflows/version-check.py index 74c061ee9e95..f2cef9f86427 100755 --- a/.github/workflows/version-check.py +++ b/.github/workflows/version-check.py @@ -4,25 +4,29 @@ import re import sys + +def get_version_from_tag(tag): + m = re.match('llvmorg-([0-9]+)\.([0-9]+)\.([0-9]+)(-rc[0-9]+)?$', tag) + if m: + if m.lastindex == 4: + # We have an rc tag. + return m.group(1,2,3) + # We have a final release tag. + return (m.group(1), m.group(2), int(m.group(3)) + 1) + + m = re.match('llvmorg-([0-9]+)-init', tag) + if m: + return (int(m.group(1)) + 1, 0, 0) + + raise Exception(f"error: Tag is not valid: {tag}") + + version = sys.argv[1] repo = Repo() tag = repo.git.describe(tags = True, abbrev=0) -m = re.match('llvmorg-([0-9]+)\.([0-9]+)\.([0-9]+)', tag) -if not m: - print("error: Tag is not valid: ", tag) - sys.exit(1) - -expected_major = m.group(1) -expected_minor = m.group(2) -expected_patch = int(m.group(3)) + 1 -expected_version = f"{expected_major}.{expected_minor}.{expected_patch}" - -m = re.match("[0-9]+\.[0-9]+\.[0-9]+", version) -if not m: - print("error: Version is not valid: ", version) - sys.exit(1) +expected_version = '.'.join(get_version_from_tag(tag)) if version != expected_version: print("error: Expected version", expected_version, "but found version", version) diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index 38e5e9f8ef9c..8f89db32a36f 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -4,13 +4,15 @@ on: push: branches: - 'release/**' - pull_request: + pull_request: + branches: + - 'release/**' jobs: version_check: + if: github.repository_owner == 'llvm' runs-on: ubuntu-latest - if: github.repository == 'llvm/llvm-project' steps: - name: Fetch LLVM sources uses: actions/checkout@v2