Skip to content

Commit

Permalink
Merge pull request #8 from manhtukhang/dev
Browse files Browse the repository at this point in the history
Upgrade Go version + updating CI workflows
  • Loading branch information
manhtukhang authored Apr 21, 2024
2 parents 96e067e + 16c5564 commit 4f97a99
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/greet.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: First interaction

on:
push:
branches:
- main
pull_request:
branches:
- main
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
name: Lint
on:
push:
tags:
- v*
branches:
- '**'
pull_request:
jobs:
pre_job:
# continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
cancel_others: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
golangci:
name: GolangCI Lint
needs: pre_job
runs-on: ubuntu-latest
if: needs.pre_job.outputs.should_skip != 'true'
steps:
- uses: actions/checkout@v4
- name: golangci-lint
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: Security scanning
on:
push:
tags:
- v*
branches:
- main
schedule:
- cron: '0 0 * * *' # daily

jobs:
security:
if: github.repository == 'manhtukhang/vault-plugin-secrets-nexus-repository'
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -19,3 +22,10 @@ jobs:
uses: snyk/actions/golang@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true # To make sure that SARIF upload gets called
with:
args: --sarif-file-output=snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif
24 changes: 18 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@ name: Test

on:
push:
branches:
- "**"
pull_request:

jobs:
pre_job:
# continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
cancel_others: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
test:
name: Test
needs: pre_job
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -23,11 +35,11 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y make
- name: Setup gotest
run: curl -L https://gotest-release.s3.amazonaws.com/gotest_linux > gotest && chmod +x gotest && sudo mv gotest /usr/bin/gotest
#
- name: Test
if: github.event_name == 'pull_request'
run: make test


if: needs.pre_job.outputs.should_skip != 'true'
run: make test-coverage
#
- name: Hack Code Climate and Go Modules
if: github.event_name != 'pull_request' && github.ref_name == 'main'
run: mkdir -p github.com/${{ github.repository_owner }} && ln -sf $(pwd) github.com/${{ github.repository }}
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/manhtukhang/vault-plugin-secrets-nexus-repository

go 1.22

toolchain go1.22.0
go 1.22.1

require (
github.com/datadrivers/go-nexus-client v1.10.0
Expand Down

0 comments on commit 4f97a99

Please sign in to comment.