Skip to content

Commit

Permalink
Use environments to gate execution of tests in PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
F21 committed Mar 6, 2024
1 parent 924f73a commit 0e9fd73
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "pull requests"
on:
pull_request_target:

jobs:
lint:
runs-on: ubuntu-latest
environment:
name: "Acceptance Tests"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: npm ci
- run: npm run lint
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
environment:
name: "Acceptance Tests"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: npm ci && npm run build
- uses: ./
with:
organization: ${{ secrets.CLOUDFLARE_ACCESS_ORGANIZATION }}
auth_client_id: ${{ secrets.CLOUDFLARE_ACCESS_CLIENT_ID }}
auth_client_secret: ${{ secrets.CLOUDFLARE_ACCESS_CLIENT_SECRET }}
- run: wget https://www.google.com
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: "tests"
on:
pull_request:
push:
branches:
- main
Expand Down

0 comments on commit 0e9fd73

Please sign in to comment.