mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-12-24 12:37:53 +08:00
66 lines
2.0 KiB
Plaintext
66 lines
2.0 KiB
Plaintext
name: go-ci
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: set up
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.22.4
|
|
id: go
|
|
- name: check out
|
|
uses: actions/checkout@v3
|
|
- name: Cache
|
|
uses: actions/cache@v2.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: Configure Git for Private Modules
|
|
run: |
|
|
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
|
git config --global url."git@github.com:".insteadOf "https://github.com/"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
env:
|
|
GOPRIVATE: github.com/oneclickvirt/security
|
|
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
|
|
build:
|
|
needs: setup
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Configure Git for Private Modules
|
|
run: |
|
|
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
|
git config --global url."git@github.com:".insteadOf "https://github.com/"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
- name: build
|
|
run: go build ./...
|
|
env:
|
|
GOPRIVATE: github.com/oneclickvirt/security
|
|
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
|
|
# test:
|
|
# needs: setup
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/checkout@v3
|
|
# - name: Configure Git for Private Modules
|
|
# run: |
|
|
# git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
|
# git config --global url."git@github.com:".insteadOf "https://github.com/"
|
|
# env:
|
|
# GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
# - name: test
|
|
# run: go test ./goecs_test.go
|
|
# env:
|
|
# GOPRIVATE: github.com/oneclickvirt/security
|
|
# GITHUB_TOKEN: ${{ secrets.GHT }} |