From 647e439509690126e9fcb01cce0eebff8a8fcad8 Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Wed, 2 Oct 2024 14:56:31 -0700 Subject: [PATCH] Upgrade go versions and action versions. Add action to generate connector capabilities. --- .github/workflows/capabilities.yaml | 61 +++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 18 ++++----- .github/workflows/release.yaml | 12 +++--- 3 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/capabilities.yaml diff --git a/.github/workflows/capabilities.yaml b/.github/workflows/capabilities.yaml new file mode 100644 index 0000000..9bc3f21 --- /dev/null +++ b/.github/workflows/capabilities.yaml @@ -0,0 +1,61 @@ +name: Generate connector capabilities + +on: + push: + branches: + - main + +jobs: + calculate-capabilities: + runs-on: ubuntu-latest + services: + openldap: + image: osixia/openldap:latest + ports: + - "389:389" + - "636:636" + env: + LDAP_ORGANISATION: example + LDAP_DOMAIN: example.org + LDAP_ADMIN_USERNAME: admin + LDAP_ADMIN_PASSWORD: admin + LDAP_CONFIG_PASSWORD: config_pass + LDAP_BASE_DN: "dc=example,dc=org" + BITNAMI_DEBUG: true + LDAP_REMOVE_CONFIG_AFTER_SETUP: false + LDAP_ENABLE_TLS: true + LDAP_LDAPS_PORT_NUMBER: 636 + LDAP_TLS_CERT_FILE: /container/service/slapd/assets/certs/ldap.crt + LDAP_TLS_KEY_FILE: /container/service/slapd/assets/certs/ldap.key + LDAP_TLS_CA_FILE: /container/service/slapd/assets/certs/ca.crt + LDAP_TLS_VERIFY_CLIENT: try + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.RELENG_GITHUB_TOKEN }} + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Build + run: go build -o connector ./cmd/baton-ldap + + - name: Run and save output + env: + BATON_PASSWORD: admin + BATON_BASE_DN: 'dc=example,dc=org' + BATON_USER_DN: 'CN=admin,DC=example,DC=org' + BATON_URL: 'ldaps://localhost' + BATON_INSECURE_SKIP_VERIFY: true + run: ./connector capabilities > baton_capabilities.json + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: 'Updating baton capabilities.' + add: 'baton_capabilities.json' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4ecfef..f2cf7d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run linters uses: golangci/golangci-lint-action@v3 with: @@ -24,17 +24,17 @@ jobs: go-test: strategy: matrix: - go-version: [1.21.x] + go-version: [1.22.x] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - name: Install Go if: success() - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: go tests run: go test -v -covermode=count -json ./... > test.json - name: annotate go tests @@ -73,11 +73,11 @@ jobs: BATON_INSECURE_SKIP_VERIFY: true steps: - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node.js uses: actions/setup-node@v3 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0d3e36c..6ee2141 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,13 +10,13 @@ jobs: runs-on: macos-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Set up Gon run: brew tap conductorone/gon && brew install conductorone/gon/gon - name: Import Keychain Certs @@ -37,13 +37,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Docker Login uses: docker/login-action@v1 with: