Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use composite actions #5483

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,21 @@ jobs:
name: Test Builds
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
uses: projectdiscovery/actions/setup/go@v1

- name: Set up Python # required for running python code in py-snippet.yaml integration test
# required for running python code in py-snippet.yaml integration test
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Check out code
uses: actions/checkout@v3

- name: Go Mod hygiene
run: |
go clean -modcache
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: projectdiscovery/actions/setup/go@v1

- name: Functional Tests
env:
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ jobs:
name: Lint Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: projectdiscovery/actions/setup/go@v1

- name: Run golangci-lint
uses: golangci/[email protected]
with:
version: latest
args: --timeout 5m
uses: projectdiscovery/actions/golangci-lint@v1
11 changes: 4 additions & 7 deletions .github/workflows/performance-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ jobs:
name: Test Performance
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, macOS-latest]

runs-on: ${{ matrix.os }}
if: github.repository == 'projectdiscovery/nuclei'
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: projectdiscovery/actions/setup/go@v1

- name: Go Mod hygine
run: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Set up Go"
uses: actions/setup-go@v4
with:
go-version: 1.21.x
uses: projectdiscovery/actions/setup/go@v1

- name: "Set up Git"
uses: projectdiscovery/actions/setup/git@v1

- name: Generate YAML Syntax Documentation
id: generate-docs
Expand All @@ -35,8 +36,6 @@ jobs:
- name: Commit files
if: steps.generate-docs.outputs.CHANGES > 0
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add SYNTAX-REFERENCE.md nuclei-jsonschema.json
git commit -m "Auto Generate Syntax Docs + JSONSchema [$(date)] :robot:" -a

Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ on:
jobs:
release:
runs-on: ubuntu-latest-16-cores

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Set up Go
uses: projectdiscovery/actions/setup/go@v1

- uses: goreleaser/goreleaser-action@v4
- uses: projectdiscovery/actions/goreleaser@v1
with:
args: "release --clean"
version: latest
release: true
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
SLACK_WEBHOOK: "${{ secrets.RELEASE_SLACK_WEBHOOK }}"
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ jobs:
runs-on: ubuntu-latest-16-cores
steps:
- name: "Check out code"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
uses: projectdiscovery/actions/setup/go@v1

- name: release test
uses: goreleaser/goreleaser-action@v4
with:
args: "release --clean --snapshot"
version: latest
- name: Release snapshot
uses: projectdiscovery/actions/goreleaser@v1
7 changes: 3 additions & 4 deletions .github/workflows/template-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ jobs:
build:
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.21.x
- uses: actions/checkout@v4

- uses: projectdiscovery/actions/setup/go@v1

- name: Template Validation
run: |
Expand Down
Loading