-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
- Loading branch information
0 parents
commit 1c82205
Showing
7 changed files
with
533 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: goreleaser | ||
|
||
on: | ||
create: | ||
|
||
jobs: | ||
goreleaser: | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v3 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform-provider-ceph | ||
.terraform | ||
terraform.tfstate | ||
terraform.tfstate.backup | ||
*.swp | ||
terraform.log | ||
.vscode | ||
dist/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
|
||
stages: | ||
- build | ||
- security | ||
- qa | ||
- misc | ||
- release | ||
|
||
include: | ||
- template: SAST.gitlab-ci.yml | ||
- template: Security/Dependency-Scanning.gitlab-ci.yml | ||
- template: Security/Secret-Detection.gitlab-ci.yml | ||
|
||
build: | ||
stage: build | ||
image: golang:1.17 | ||
script: | ||
- make build | ||
artifacts: | ||
expose_as: 'terraform-provider-ceph' | ||
paths: | ||
- terraform-provider-ceph | ||
|
||
sast: | ||
stage: security | ||
needs: [] | ||
|
||
dependency_scanning: | ||
stage: security | ||
needs: [] | ||
|
||
secret_detection: | ||
stage: security | ||
needs: [] | ||
|
||
golang-lint: | ||
stage: qa | ||
needs: [] | ||
image: golangci/golangci-lint:v1.45 | ||
script: | ||
- golangci-lint run -v | ||
|
||
test-go-generate: | ||
stage: qa | ||
needs: [] | ||
image: golang:1.17 | ||
variables: | ||
TERRAFORM_VERSION: 1.1.8 | ||
script: | ||
- apt-get update && apt-get install zip -y | ||
- wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip | ||
- unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin | ||
- go generate | ||
- | | ||
git diff --compact-summary --exit-code || | ||
(echo; | ||
echo "Unexpected difference in directories after code generation. Run 'go generate' command and commit."; | ||
exit 1) | ||
code_navigation: | ||
stage: misc | ||
image: sourcegraph/lsif-go:v1 | ||
needs: [] | ||
script: | ||
- lsif-go | ||
allow_failure: true # recommended | ||
artifacts: | ||
reports: | ||
lsif: dump.lsif | ||
|
||
release: | ||
stage: release | ||
image: | ||
name: goreleaser/goreleaser:v1.9.2 | ||
entrypoint: [''] | ||
only: | ||
- tags | ||
variables: | ||
# Disable shallow cloning so that goreleaser can diff between tags to | ||
# generate a changelog. | ||
GIT_DEPTH: 0 | ||
before_script: | ||
- apk add gpg-agent | ||
- gpg --import < $GPG_PRIVATE_KEY_FILE | ||
script: | ||
- goreleaser release --rm-dist |
Oops, something went wrong.