Skip to content

Commit

Permalink
[github] Make workflows consistent with workflows in mainline LLVM.
Browse files Browse the repository at this point in the history
  • Loading branch information
neboat committed Aug 26, 2022
1 parent 602a75a commit ac9e020
Show file tree
Hide file tree
Showing 15 changed files with 302 additions and 209 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/clang-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Clang Tests

on:
workflow_dispatch:
push:
branches:
- 'release/**'
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/closed-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
steps:
- uses: andymckay/[email protected]
with:
remove-labels: "awaiting-review"
remove-labels: 'awaiting-review'
26 changes: 17 additions & 9 deletions .github/workflows/issue-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# /cherry-pick <commit> <...>
#
# 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 <owner>/<repo>/<branch>
Expand All @@ -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, '<!--IGNORE-->') &&
contains(github.event.comment.body, '/cherry-pick')
(github.repository == 'llvm/llvm-project') &&
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
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
Expand All @@ -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, '<!--IGNORE-->') &&
contains(github.event.comment.body, '/branch')
(github.repository == 'llvm/llvm-project') &&
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
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
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/issue-subscriber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
30 changes: 18 additions & 12 deletions .github/workflows/libclang-abi-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 }}
Expand All @@ -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

Expand Down Expand Up @@ -76,6 +82,7 @@ jobs:
abi-dump:
if: github.repository_owner == 'llvm'
needs: abi-dump-setup
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -119,19 +126,18 @@ 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:
name: ${{ matrix.name }}
path: "*${{ matrix.ref }}.abi"

abi-compare:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-latest
needs:
- abi-dump-setup
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/libclc-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: libclc Tests

on:
workflow_dispatch:
push:
branches:
- 'release/**'
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/lld-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .github/workflows/lldb-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: lldb Tests

on:
workflow_dispatch:
push:
branches:
- 'release/**'
Expand Down Expand Up @@ -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
31 changes: 16 additions & 15 deletions .github/workflows/llvm-bugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 <[email protected]>",
to: "[email protected]",
from: 'LLVM Bugs <[email protected]>',
to: '[email protected]',
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));
5 changes: 0 additions & 5 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading

0 comments on commit ac9e020

Please sign in to comment.