diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..62d9e62 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,22 @@ +--- + +name: tests + +on: push + +jobs: + test-action: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} + + - name: Workbench up + uses: ./ diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..eaef26e --- /dev/null +++ b/action.yaml @@ -0,0 +1,47 @@ +name: Workbench Up + +description: "Run workbench up with default configuration to start S3C workbench environment" + +inputs: + environment: + description: "Name of the environment to start (defaults to 'default')" + required: false + default: "default" + environment-dir: + description: "Directory to store the environment" + required: false + default: "env" + build: + description: "Build images before starting containers" + required: false + default: "false" + no-cache: + description: "Do not use cache when building images" + required: false + default: "false" + +runs: + using: "composite" + steps: + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.24.3' + + - name: Build workbench + shell: bash + run: | + make build + sudo mv workbench /usr/local/bin/workbench + working-directory: ${{ github.action_path }} + + - name: Start workbench environment + shell: bash + run: | + workbench up \ + --detach \ + --name ${{ inputs.environment }} \ + --env-dir ${{ inputs.environment-dir }} \ + ${{ inputs.build == 'true' && '--build' || '' }} \ + ${{ inputs.no-cache == 'true' && '--no-cache' || '' }}