Add Auth0 SAML support #441
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
# Run tests for all PRs | |
pull_request: | |
env: | |
VAULT_ADDR: https://vault.eng.aserto.com/ | |
PRE_RELEASE: ${{ github.ref == 'refs/heads/main' && 'main' || '' }} | |
GO_VERSION: "1.19" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Read Configuration | |
uses: hashicorp/[email protected] | |
id: vault | |
with: | |
url: ${{ env.VAULT_ADDR }} | |
token: ${{ secrets.VAULT_TOKEN }} | |
secrets: | | |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY; | |
- | |
uses: actions/checkout@v3 | |
- | |
name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- | |
name: Setup caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
.ext | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum', 'Depfile') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- | |
name: Install Tools | |
run: | | |
mkdir -p $HOME/.ssh | |
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa | |
ssh-keyscan github.com >> $HOME/.ssh/known_hosts | |
git config --global url."[email protected]:".insteadOf https://github.com/ | |
git config --global user.email "[email protected]" | |
git config --global user.name "Aserto Bot" | |
go run mage.go deps | |
- name: Lint | |
run: | | |
go work edit -json | jq -r '.Use[].DiskPath' | xargs -I{} .ext/gobin/golangci-lint-v1.52.2/golangci-lint run {}/... -c .golangci.yaml | |
- name: Test | |
run: | | |
go work edit -json | jq -r '.Use[].DiskPath' | xargs -I{} .ext/gobin/gotestsum-v1.10.0/gotestsum --format short-verbose -- -count=1 -v {}/... | |
release: | |
needs: test | |
runs-on: ubuntu-latest | |
# Only release when ref is a tag | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- | |
name: Read Configuration | |
uses: hashicorp/[email protected] | |
id: vault | |
with: | |
url: ${{ env.VAULT_ADDR }} | |
token: ${{ secrets.VAULT_TOKEN }} | |
secrets: | | |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY; | |
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN; | |
kv/data/github "ASERTO_TAP" | ASERTO_TAP; | |
- | |
uses: actions/checkout@v3 | |
- | |
name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- | |
name: Setup caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
.ext | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum', 'Depfile') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- | |
name: Install Tools | |
run: | | |
mkdir -p $HOME/.ssh | |
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa | |
ssh-keyscan github.com >> $HOME/.ssh/known_hosts | |
git config --global url."[email protected]:".insteadOf https://github.com/ | |
git config --global user.email "[email protected]" | |
git config --global user.name "Aserto Bot" | |
go run mage.go deps | |
- | |
name: Release | |
env: | |
ASERTO_TAP: ${{ steps.vault.outputs.ASERTO_TAP }} | |
GITHUB_TOKEN: ${{ steps.vault.outputs.READ_WRITE_TOKEN }} | |
run: | | |
go run mage.go release |