Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneM committed Feb 13, 2024
1 parent e9a048b commit c268bcd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,50 @@ permissions:
jobs:
linter:
name: golangci-lint
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
- name: Get golangci-lint configuration file
run: wget --output-document=/tmp/golangci.yml https://sc-devtools.s3.eu-west-1.amazonaws.com/golang-ci/golangci.yml
- uses: golangci/golangci-lint-action@v4
run: wget --output-document=$(pwd)/.golangci.yml https://sc-devtools.s3.eu-west-1.amazonaws.com/golang-ci/golangci.yml
- name: "Execute golangci-lint on the master branch"
uses: golangci/golangci-lint-action@v4
if: github.ref == 'refs/heads/master'
with:
# This flag is not working (https://github.com/golangci/golangci-lint-action/issues/531).
# We rather decided to use the suggestion from the FAQ (https://golangci-lint.run/usage/faq/#how-to-integrate-golangci-lint-into-large-project-with-thousands-of-issues) and use `--new` and `--new-from-rev`
# only-new-issues: false
# args: "--config=/tmp/golangci.yml"
args: "--config=$(pwd)/.golangci.yml --new --new-from-rev=HEAD"
- name: Get master branch commit ID
if: github.ref != 'refs/heads/master'
id: new-from-rev
run: echo "NEW_FROM_REV=$( git show-branch --merge-base FETCH_HEAD )" >> "$GITHUB_OUTPUT"
- name: Display the commit ID
if: github.ref != 'refs/heads/master'
env:
NEW_FROM_REV: ${{ steps.new-from-rev.outputs.NEW_FROM_REV }}
run: echo "Master branch commit ID $NEW_FROM_REV"
- name: "Execute golangci-lint on a pull request"
uses: golangci/golangci-lint-action@v4
if: github.ref != 'refs/heads/master'
env:
NEW_FROM_REV: ${{ steps.new-from-rev.outputs.NEW_FROM_REV }}
with:
# This flag is not working (https://github.com/golangci/golangci-lint-action/issues/531).
# We rather decided to use the suggestion from the FAQ (https://golangci-lint.run/usage/faq/#how-to-integrate-golangci-lint-into-large-project-with-thousands-of-issues) and use `--new` and `--new-from-rev`
# only-new-issues: false
args: "--config=/tmp/golangci.yml --new --new-from-rev=HEAD~1"
# args: "--config=/tmp/golangci.yml"
args: "--config=$(pwd)/.golangci.yml --new-from-rev=${{ steps.new-from-rev.outputs.NEW_FROM_REV }}"

tests:
name: Unit Tests
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -42,7 +67,7 @@ jobs:
needs: [linter, tests]
name: GoReleaser Build on All OS but Windows
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion cmd/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
if key == "domain.key" {
key = ""
}
err = domains.Add(c.Context, currentApp, c.Args().First(), cert, key)
domains.Add(c.Context, currentApp, c.Args().First(), cert, key)
} else {
cli.ShowCommandHelp(c, "domains-add")
}
Expand Down

0 comments on commit c268bcd

Please sign in to comment.