Skip to content

Commit

Permalink
Update CI to run on fork-based PRs and use proper repo when checking …
Browse files Browse the repository at this point in the history
…out (#1978)

* Update CI to run on PR and use proper ref

Signed-off-by: Yashodhan Joshi <[email protected]>

* Fetch GITHUB_REF and then checkout GITHUB_SHA

Signed-off-by: Yashodhan Joshi <[email protected]>

---------

Signed-off-by: Yashodhan Joshi <[email protected]>
  • Loading branch information
YJDoc2 authored Mar 20, 2024
1 parent 188dfcf commit 621668a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Docs website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: Format

on: [push]
on:
push: # allow for all branches, so forks can also validate on their own
pull_request:
branches: [main]

jobs:
format:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install stable
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -37,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Fud Formatting check
uses: psf/black@stable
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/fud2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: fud2 tests

on:
push:
branches: [main]
pull_request:
branches: [main]

Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test

on: [push]
on:
push:
pull_request:
branches: [main]

# Ensures that only the latest commit of a PR can execute the actions.
# Useful for cancelling job when a sequence of commits are quickly added.
Expand All @@ -18,7 +21,7 @@ jobs:
exists: ${{ steps.exists.outputs.exists }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: calyxir/calyx
ref: ${{ github.sha }}
Expand Down Expand Up @@ -83,8 +86,9 @@ jobs:
working-directory: /home/calyx
run: |
git init
git remote add origin https://github.com/calyxir/calyx.git
git remote add origin https://github.com/${{ github.repository }}.git
git fetch --all
git fetch origin $GITHUB_REF
git checkout -f $GITHUB_SHA
git clean -fd
Expand Down Expand Up @@ -134,8 +138,9 @@ jobs:
working-directory: /home/calyx
run: |
git init
git remote add origin https://github.com/calyxir/calyx.git
git remote add origin https://github.com/${{ github.repository }}.git
git fetch --all
git fetch origin $GITHUB_REF
git checkout -f $GITHUB_SHA
git clean -fd
Expand Down Expand Up @@ -193,8 +198,9 @@ jobs:
working-directory: /home/calyx
run: |
git init
git remote add origin https://github.com/calyxir/calyx.git
git remote add origin https://github.com/${{ github.repository }}.git
git fetch --all
git fetch origin $GITHUB_REF
git checkout -f $GITHUB_SHA
git clean -fd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
container: ghcr.io/cucapra/calyx:latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Get bwrap for opam
run: |
apt-get update -y
Expand Down

0 comments on commit 621668a

Please sign in to comment.