Skip to content

Add GitHub OIDC support #37

Add GitHub OIDC support

Add GitHub OIDC support #37

Workflow file for this run

name: ksd-ci
on:
push:
branches: [ main ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
binary: ksd
artifact: ksd.linux
- os: windows-latest
binary: ksd.exe
artifact: ksd.windows
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- name: Build
run: go build
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Test (PR)
if: ${{ github.event_name == 'pull_request' }}
run: >
gotestsum
--format testname
--
-race
-coverprofile='coverage.txt'
-covermode=atomic
-coverpkg='./...'
./...
- name: Test (Full)
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
run: >
gotestsum
--format testname
--
-race
-coverprofile='coverage.txt'
-covermode=atomic
-coverpkg='./...'
./...
env:
KSD_TEST_CLIENT_SECRET: ${{ secrets.KSD_TEST_CLIENT_SECRET }}
KSD_TEST_CLIENT_ID: ${{ vars.KSD_TEST_CLIENT_ID }}
KSD_TEST_TENANT_ID: ${{ vars.KSD_TEST_TENANT_ID }}
KSD_TEST_ENDPOINT: ${{ vars.KSD_TEST_ENDPOINT }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
with:
name: ${{ matrix.artifact }}
path: |
${{ matrix.binary }}