add github auth #28
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: | |
pull_request: | |
push: | |
branches: | |
- main | |
- dev | |
# paths: | |
# - 'test/resources/**' | |
permissions: | |
# Allow action to write raw configs back to the repository. | |
contents: write | |
jobs: | |
shellcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install ShellCheck | |
run: sudo apt-get install shellcheck | |
- name: Run ShellCheck | |
run: shellcheck -x -s bash entrypoint.sh | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
bindplane_versions: | |
- 1.40.0 | |
- 1.37.0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Detect Runner IP | |
run: echo "MAIN_IP=$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d'/' | head -n 1)" >> $GITHUB_ENV | |
- name: Print Runner IP | |
run: echo $MAIN_IP | |
- name: Pull BindPlane | |
run: docker pull ghcr.io/observiq/bindplane-ee:${{ matrix.bindplane_versions }} | |
- name: Start BindPlane | |
run: | | |
docker run \ | |
-d \ | |
--name bindplane \ | |
-e BINDPLANE_USERNAME=admin \ | |
-e BINDPLANE_PASSWORD=admin \ | |
-e BINDPLANE_REMOTE_URL=http://${MAIN_IP}:3001 \ | |
-e BINDPLANE_SESSION_SECRET=2c23c9d3-850f-4062-a5c8-3f9b814ae144 \ | |
-e BINDPLANE_SECRET_KEY=8a5353f7-bbf4-4eea-846d-a6d54296b781 \ | |
-e BINDPLANE_LOG_OUTPUT=stdout \ | |
-e BINDPLANE_ACCEPT_EULA=true \ | |
-p 3001:3001 \ | |
ghcr.io/observiq/bindplane-ee:${{ matrix.bindplane_versions }} | |
- name: Wait for BindPlane | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 1 | |
polling_interval_seconds: 5 | |
max_attempts: 10 | |
shell: bash | |
command: docker exec bindplane /bindplane get agent | |
- name: Run BindPlane Action | |
# This should be replaced with a release action. | |
# <organization>/<repository>@<tag> | |
uses: ./ | |
with: | |
# These values are hardcode to match the test instance used by | |
# this workflow. The instance does not persist. Consumers of | |
# this action should always use secrets when passing in the remote | |
# url, username, password or api key. | |
# | |
# Remote url will never be localhost when running this action. The action | |
# executes in a container and localhost will always be the container's network | |
# and not the network of the bindplane instance, even if that instance | |
# is running within this runner. | |
remote_url: http://${{ env.MAIN_IP }}:3001 | |
username: admin | |
password: admin | |
# Testing tailing and non trailing slash | |
destination_path: test/resources/destinations/resource.yaml | |
configuration_path: test/resources/configurations/resource.yaml | |
configuration_output_dir: test/otel/{{ matrix.bindplane_versions }} | |
configuration_output_branch: dev | |
# Token should have contents: write permissions | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get Resources | |
if: always() | |
run: | | |
docker exec bindplane /bindplane get destinations | |
docker exec bindplane /bindplane get configurations | |
- name: Debug Container Logs | |
if: always() | |
run: docker logs bindplane |