mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00

- Update GitHub Actions to use newer versions (checkout to v4, codeql-action to v3, setup-go to v5, goreleaser-action to v5, golangci-lint-action to v4, codecov-action to v4) - Remove specific Go version pinning in favor of using the version specified in go.mod - Enable checking for the latest Go version in setup-go action - Replace `release --rm-dist` argument with `release --clean` in goreleaser action - Reorder steps and remove redundant checkout step in testing workflow Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
name: Lint and Testing
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
check-latest: true
|
|
|
|
- name: Setup golangci-lint
|
|
uses: golangci/golangci-lint-action@v4
|
|
with:
|
|
version: latest
|
|
args: --verbose
|
|
|
|
- uses: hadolint/hadolint-action@v3.1.0
|
|
name: hadolint for Dockerfile
|
|
with:
|
|
dockerfile: docker/Dockerfile
|
|
|
|
testing:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: golang:1.21-alpine
|
|
options: --sysctl net.ipv6.conf.all.disable_ipv6=0
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: setup sshd server
|
|
run: |
|
|
apk add git make curl perl bash build-base zlib-dev ucl-dev sudo
|
|
make ssh-server
|
|
|
|
- name: testing
|
|
run: |
|
|
make test
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|