mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
* upgrade go version to 1.25.1 * introduce doc for steps for creating a new pkg manager * Update docs/package-manager.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com> * Update docs/package-manager.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com> * Update docs/package-manager.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com> --------- Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
104 lines
2.8 KiB
YAML
104 lines
2.8 KiB
YAML
name: CI
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
run-test:
|
|
timeout-minutes: 15
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Build and Test
|
|
run: |
|
|
go mod tidy
|
|
go build
|
|
go test -coverprofile=coverage.txt -v ./...
|
|
|
|
- name: Upload Coverage
|
|
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push'
|
|
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
e2e-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: 20
|
|
check-latest: true
|
|
|
|
- name: Setup PNPM
|
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Build Binary
|
|
run: make
|
|
|
|
- name: Run E2E Tests
|
|
run: chmod +x test/e2e.sh && ./test/e2e.sh
|
|
shell: bash
|
|
|
|
goreleaser-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Run Goreleaser
|
|
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
|
|
with:
|
|
distribution: goreleaser
|
|
version: "~> v2"
|
|
args: build --clean --snapshot
|
|
|
|
build-container-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
|
|
- name: Setup QEMU
|
|
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
|
|
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
|
|
|
|
- name: Build Container Image
|
|
run: |
|
|
docker buildx build --platform linux/amd64 --load \
|
|
-t build-container-test:latest .
|