Skip to content

chore: test deb

chore: test deb #29

Workflow file for this run

# - When a third-party action is added (i.e., `uses`), please also add it to `download-licenses` in Makefile.
# - When a job is added/removed/renamed, please make corresponding changes in ci-docs.yaml.
name: CI
on:
push:
branches:
- main
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/e2e-macos.yaml'
- '.github/workflows/e2e-windows.yaml'
- '.github/workflows/e2e-linux.yaml'
- 'contrib/packaging/**'
- 'deps/**'
- 'finch.yaml.d/**'
- 'winres'
- 'Makefile*'
- '.golangci.yaml'
- '!contrib/hello-finch/**'
pull_request:
branches:
- main
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/e2e-macos.yaml'
- '.github/workflows/e2e-windows.yaml'
- '.github/workflows/e2e-linux.yaml'
- 'contrib/packaging/**'
- 'deps/**'
- 'finch.yaml.d/**'
- 'winres'
- 'Makefile*'
- '.golangci.yaml'
- '!contrib/hello-finch/**'
workflow_dispatch:
permissions:
id-token: write
contents: write
env:
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
GO_VERSION: '1.24.6'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
git-secrets:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Pull latest awslabs/git-secrets repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: awslabs/git-secrets
ref: 1.3.0
fetch-tags: true
path: git-secrets
- name: Install git secrets from source
run: sudo make install
working-directory: git-secrets
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Scan repository for git secrets
run: |
git secrets --register-aws
git secrets --scan-history
get-latest-tag:
name: Get the latest release tag
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
tag: ${{ steps.latest-tag.outputs.tag }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: 'Get the latest tag'
id: latest-tag
uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0
gen-code-no-diff:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- run: make gen-code
- run: git diff --exit-code
unit-tests:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- name: Configure git CRLF settings
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- run: make test-unit
# 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:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: set GOOS env to windows
run: |
echo "GOOS=windows" >> $GITHUB_ENV
- name: golangci-lint - windows
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
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: v2.1.0
args: --fix=false --timeout=5m
- name: set GOOS env to darwin
run: |
echo "GOOS=darwin" >> $GITHUB_ENV
- name: golangci-lint - darwin
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
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: v2.1.0
args: --fix=false --timeout=5m --skip-dirs="(^|/)deps($|/)"
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
with:
version: v0.9.0
continue-on-error: true
go-mod-tidy-check:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
# 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
check-licenses:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- run: make check-licenses
macos-e2e-tests:
strategy:
fail-fast: false
matrix:
version: ['13', '14']
test-command: ['test-e2e-vm-serial', 'test-e2e-container', 'test-e2e-daemon']
arch: ['X64', 'arm64']
runner-type: ['test']
uses: ./.github/workflows/e2e-macos.yaml
secrets: inherit
with:
arch: ${{ matrix.arch }}
version: ${{ matrix.version }}
runner-type: ${{ matrix.runner-type }}
test-command: ${{ matrix.test-command }}
windows-e2e-tests:
strategy:
fail-fast: false
matrix:
test-command: ['test-e2e-vm-serial', 'test-e2e-container']
arch: ['amd64']
runner-type: ['test']
uses: ./.github/workflows/e2e-windows.yaml
secrets: inherit
with:
arch: ${{ matrix.arch }}
runner-type: ${{ matrix.runner-type }}
test-command: ${{ matrix.test-command }}
linux-e2e-tests:
strategy:
fail-fast: false
matrix:
os: ['amazonlinux']
arch: ['X64', 'arm64']
version: ['2023', '2']
runner-type: ['test']
uses: ./.github/workflows/e2e-linux.yaml
secrets: inherit
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
version: ${{ matrix.version }}
runner-type: ${{ matrix.runner-type }}
ubuntu-e2e-tests:
strategy:
fail-fast: false
matrix:
arch: ['x86_64', 'arm64']
include:
- arch: 'x86_64'
output-arch: 'amd64'
- arch: 'arm64'
output-arch: 'arm64'
uses: ./.github/workflows/e2e-ubuntu.yaml
secrets: inherit
with:
arch: ${{ matrix.arch }}
output-arch: ${{ matrix.output-arch }}
mdlint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb # v1.5.0
with:
args: '**/*.md'
# CHANGELOG.md is only updated by release-please bot.
ignore: 'CHANGELOG.md'