Skip to content

Commit

Permalink
ci: run with tests in GitHub Actions
Browse files Browse the repository at this point in the history
Run linting, unit tests, and system tests
with GitHub Actions. Remove these from the
Jenkinsfile.

We also remove microbenchmarks and hey-apm
stages from Jenkins, but without replacement.
We are only making critical bug fixes to 7.17,
so these stages are not necessary; we can run
benchmarks locally or on a dedicated machine
as needed.

Use LF (not CRLF) on Windows for testdata
files (*.ndjson, *.json, *.map).
  • Loading branch information
axw committed Jun 22, 2023
1 parent 9794381 commit bdfd970
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 545 deletions.
381 changes: 12 additions & 369 deletions .ci/Jenkinsfile

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions .ci/scripts/build.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .ci/scripts/intake.sh

This file was deleted.

20 changes: 0 additions & 20 deletions .ci/scripts/linux-test.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .ci/scripts/unit-test.sh

This file was deleted.

50 changes: 0 additions & 50 deletions .ci/scripts/windows-build.ps1

This file was deleted.

46 changes: 0 additions & 46 deletions .ci/scripts/windows-test.ps1

This file was deleted.

3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
CHANGELOG.asciidoc merge=union
internal/otel_collector linguist-generated=true
**.ndjson text eol=lf
**.json text eol=lf
**.map text eol=lf
50 changes: 46 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,60 @@
name: ci

on:
push:
branches:
- 7.1*
pull_request:

# limit the access of the generated GITHUB_TOKEN
permissions:
contents: read

jobs:
system-test:
lint:
runs-on: ubuntu-latest
steps:
- run: 'echo "No tests required to run"'
lint:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
cache-dependency-path: |
go.sum
tools/go.sum
systemtest/go.sum
- run: make check-full

test:
strategy:
matrix:
os: ['macos-latest', 'windows-latest', 'ubuntu-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
- run: go test -v ./...

python-system-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
- run: make update apm-server docker-system-tests

go-system-tests:
runs-on: ubuntu-latest
steps:
- run: 'echo "No lint required to run"'
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
- run: make apm-server
- run: cd systemtest && go test -v -timeout=20m ./...
22 changes: 0 additions & 22 deletions .github/workflows/macos.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.19.9
RUN set -x && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
netcat python3 python3-pip python3-venv && \
python3 python3-pip python3-venv && \
apt-get clean


Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:1.19.9
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN apt-get update
RUN apt-get install -y --no-install-recommends netcat python3 python3-pip python3-venv
RUN apt-get install -y --no-install-recommends python3 python3-pip python3-venv
RUN apt-get clean

ARG UID=1000
Expand Down

0 comments on commit bdfd970

Please sign in to comment.