Skip to content

Commit

Permalink
Run GitHub actions on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
erlliam authored and strager committed Oct 13, 2020
1 parent c242fc8 commit cadbfbb
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 14 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build-and-test-web-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

name: build and test web demo
on: [push]
on:
push:
pull_request:
types: [opened, synchronize]

jobs:
build:
Expand All @@ -25,8 +28,14 @@ jobs:
- uses: mymindstorm/setup-emsdk@v6
with:
version: 2.0.4
- name: check out
uses: actions/checkout@v1
- name: checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: checkout
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: C++ configure
run: emcmake cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

name: build and test
on: [push]
on:
push:
pull_request:
types: [opened, synchronize]

jobs:
build:
Expand Down Expand Up @@ -56,8 +59,15 @@ jobs:
) }}
steps:
- name: check out
uses: actions/checkout@v1
- name: checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: checkout
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: configure
run: |
env | grep '^CMAKE\|^QUICK_LINT_JS' | sort
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

name: check format
on: [push]
on:
push:
pull_request:
types: [opened, synchronize]

jobs:
check_format:
name: check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- run: clang-format --version
- run: ./tools/format
- run: git diff --exit-code
16 changes: 13 additions & 3 deletions .github/workflows/simple-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

name: simple build
on: [push]
on:
push:
pull_request:
types: [opened, synchronize]

jobs:
build:
Expand All @@ -34,7 +37,14 @@ jobs:
CXXFLAGS: ${{ matrix.toolchain.CXXFLAGS }}

steps:
- name: check out
uses: actions/checkout@v1
- name: checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: checkout
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: build
run: '"${CXX}" ${CXXFLAGS} -o quick-lint-js -I src -I vendor/boost src/*.cpp vendor/boost/libs/container/src/*.cpp vendor/boost/libs/container/src/alloc_lib.c'
16 changes: 13 additions & 3 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

name: test install
on: [push]
on:
push:
pull_request:
types: [opened, synchronize]

jobs:
build:
name: test install
runs-on: ubuntu-latest
steps:
- name: check out
uses: actions/checkout@v1
- name: checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: checkout
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: configure
run: cmake -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DBUILD_TESTING=OFF -S . -B .
- name: build
Expand Down

0 comments on commit cadbfbb

Please sign in to comment.