Skip to content

Commit

Permalink
Github Actions, on PR and push (+selectivity) (#317)
Browse files Browse the repository at this point in the history
* Github Actions, on PR and push (+selectivity)

This makes CI run on PRs as well, rather than only on the
underlying branches.
This will lead to the PR jobs actually running with the base of
the PR merged into the head.

Also be more selective about when to run some jobs, so for example
we can now make docs changes, without running the WHOLE build and
test pipeline.

* Disable scan upload to github UI
  • Loading branch information
addshore authored Mar 2, 2022
1 parent 48f8f5c commit cd5674f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/actions/scan-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ runs:
fail-build: false
image: ${{ inputs.image_name }}:${{ inputs.image_tag }}

# As this step depends on github.event.pull_request it never ran until https://github.com/wmde/wikibase-release-pipeline/pull/317 was done
# So disable it in that PR and fix it in a followup...
# uploads it to the ui
- uses: github/codeql-action/upload-sarif@v1
if: |
github.actor != 'dependabot[bot]' &&
(github.event.pull_request.head.repo.full_name == github.repository)
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
# - uses: github/codeql-action/upload-sarif@v1
# if: |
# github.actor != 'dependabot[bot]' &&
# (github.event.pull_request.head.repo.full_name == github.repository)
# with:
# sarif_file: ${{ steps.scan.outputs.sarif }}

# output to terminal and move to non-conflicting name
- name: Inspect action SARIF report
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/built_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
required: true
default: '.env' # only gets set on a "workflow_dispatch" run
push:
branches:
- "main"
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'

env:
env_file: ${{ github.event.inputs.env_file || 'versions/wmde6.env' }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Linting

on:
push:
branches:
- "main"
pull_request:

jobs:
lint_dockerfiles:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Test Example

on:
push:
branches:
- "main"
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'

jobs:
test_example:
Expand Down

0 comments on commit cd5674f

Please sign in to comment.