Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## CI/CD

There are 5 main stages that run on GitHub actions

* Build
* Lint
* Notice
* Test
* Release

There are some other stages that run for every push on the main branches:

* [Smoke Tests](./smoke-tests.yml)

### Scenarios

* Pull Requests that are only affecting the docs files should not trigger any test or similar stages that are not required.
* Builds do not get triggered automatically for Pull Requests from contributors that are not Elasticians when need to access to any GitHub Secrets.

### How to interact with the CI?

#### On a PR basis

Once a PR has been opened then there are two different ways you can trigger builds in the CI:

1. Commit based
1. UI based, any Elasticians can force a build through the GitHub UI

#### Branches

Every time there is a merge to main or any release branches the whole workflow will compile and test every entry in the compatibility matrix for Linux and MacOS.

#### Release process

This process has been fully automated and it gets triggered when a tag release has been created, for further details please refers to the [release](../../RELEASE.md) docs.

#### Smoke Tests

You can run the [smoke-tests](https://github.com/elastic/apm-aws-lambda/actions/workflows/smoke-tests.yml) using the UI if needed.

### OpenTelemetry

There is a GitHub workflow in charge to populate what the workflow run in terms of jobs and steps. Those details can be seen in [here](https://ela.st/oblt-ci-cd-stats) (**NOTE**: only available for Elasticians).
27 changes: 27 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow sets the test / ci status check to success in case it's a docs only PR and test.yml is not triggered
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
name: test # The name must be the same as in test.yml

on:
pull_request:
paths-ignore: # This expression needs to match the paths ignored on main.yml.
- '**'
- '!**/*.md'
- '!**/*.asciidoc'
- '!**/*.png'

permissions:
contents: read

## Concurrency only allowed in the main branch.
## So old builds running for old commits within the same Pull Request are cancelled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
# dummy steps that allow to bypass those mandatory checks for tests
ci:
runs-on: ubuntu-latest
steps:
- run: 'echo "Not required for docs"'
34 changes: 31 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
name: test

on:
pull_request:
paths-ignore:
- "**/*.asciidoc"
- "**/*.md"
- "**/*.png"
push:
branches:
- main
pull_request:
paths-ignore:
- "**/*.asciidoc"
- "**/*.md"
- "**/*.png"

permissions:
contents: read

## Concurrency only allowed in the main branch.
## So old builds running for old commits within the same Pull Request are cancelled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
strategy:
Expand Down Expand Up @@ -60,6 +74,20 @@ jobs:
- uses: actions/checkout@v3
- name: notice
run: make check-notice



# The very last job to report whether the Workflow passed.
# This will act as the Branch Protection gatekeeper
ci:
if: always()
needs:
- build
- lint
- notice
- test
runs-on: ubuntu-latest
steps:
- id: check
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
with:
needs: ${{ toJSON(needs) }}
- run: ${{ steps.check.outputs.isSuccess }}