mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-10-05 15:46:50 +08:00
CI runs on GitHub Actions
- on a self-hosted runner - pull requests don't trigger actions (security) - forks don't trigger actions (security) - run in a container (fedora-golang-bosh) (security)
This commit is contained in:
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@@ -3,39 +3,28 @@ name: CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
# Only run on main repo, not forks
|
||||||
|
if: github.repository == 'cunnie/sslip.io'
|
||||||
|
runs-on: self-hosted
|
||||||
|
container: cunnie/fedora-golang-bosh
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.21'
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: go build -v ./...
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: go test -v ./...
|
run: ginkgo -r -p .
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
container: cunnie/fedora-golang-bosh
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'cunnie/sslip.io'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.21'
|
|
||||||
|
|
||||||
- name: Build Release Binary
|
- name: Build Release Binary
|
||||||
run: |
|
run: |
|
||||||
GOOS=linux GOARCH=amd64 go build -o sslip-linux-amd64
|
GOOS=linux GOARCH=amd64 go build -o sslip-linux-amd64
|
||||||
|
Reference in New Issue
Block a user