ci: add barebone e2e tests with basic awslogs scenario #51
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# It's recommended to run golangci-lint in a job separate from other jobs (go test, etc) because different jobs run in parallel. | |
go-linter: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
# Pin the version in case all the builds start to fail at the same time. | |
# There may not be an automatic way (e.g., dependabot) to update a specific parameter of a GitHub Action, | |
# so we will just update it manually whenever it makes sense (e.g., a feature that we want is added). | |
version: v1.54.0 | |
args: --fix=false --timeout=5m | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
go: [ '1.17', '1.18', '1.19', '1.20', '1.21' ] | |
os: [ 'ubuntu-22.04', 'windows-2022' ] | |
name: ${{ matrix.os }} / Go ${{ matrix.go }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
cache: false | |
- name: build | |
run: make build | |
- name: test-unit | |
run: make test-unit | |
e2e-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
go: [ '1.20' ] | |
os: [ 'ubuntu-22.04' ] | |
name: ${{ matrix.os }} / Go ${{ matrix.go }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
cache: false | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.ROLE }} | |
aws-region: ${{ secrets.REGION }} | |
- name: install and start containerd | |
shell: bash | |
run: sudo scripts/install-containerd | |
- name: build | |
run: make build | |
- name: set up ip forwarding | |
shell: bash | |
run: sudo scripts/ip-forwarding | |
- name: test-e2e | |
run: make test-e2e | |
go-mod-tidy-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
# TODO: Use `go mod tidy --check` after https://github.com/golang/go/issues/27005 is fixed. | |
- run: go mod tidy | |
- run: git diff --exit-code | |
mdlint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: avto-dev/markdown-lint@v1 | |
with: | |
args: '**/*.md' | |