diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml new file mode 100644 index 0000000..a68bce4 --- /dev/null +++ b/.github/actions/run_tests/action.yml @@ -0,0 +1,32 @@ +name: "run tests" +description: "set up and run the full environment unit test suite" +inputs: + use-tag: + description: "Whether or not to test against the tag" + required: true + default: false + CHECKOUT_TOKEN: + description: "checkout token for internal repositories" + required: false + default: "" +runs: + using: "composite" + # Maybe someday default shell will be supported for actions, not just workflows + # defaults: + # run: + # shell: bash --login -eo pipefail {0} + steps: + - run: | + echo "start script" + echo $TOKEN + echo $${{ inputs.CHECKOUT_TOKEN }} + git clone "https://${TOKEN}@github.com/pcdshub/lcls-plc-kfe-xgmd-vac" --depth 1 + git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 + cd pytmc + pwd + git config --global url."https://${{ inputs.CHECKOUT_TOKEN }}@github.com/".insteadOf "https://github.com/" + git submodule update --init --recursive + ls ./pytmc/tests/projects/lcls-plc-kfe-xgmd-vac + env: + TOKEN: ${{ inputs.CHECKOUT_TOKEN }} + shell: bash --login -eo pipefail {0} \ No newline at end of file diff --git a/.github/workflows/composite_test.yml b/.github/workflows/composite_test.yml new file mode 100644 index 0000000..8bde229 --- /dev/null +++ b/.github/workflows/composite_test.yml @@ -0,0 +1,28 @@ +name: Sample composite workflow + +on: + pull_request: + release: + types: + - published + +env: + MPLBACKEND: "agg" + QT_QPA_PLATFORM: "offscreen" + +jobs: + # The latest deployed env OR the proposed env in a PR + current-tests: + environment: external-pr + defaults: + run: + shell: bash --login -eo pipefail {0} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/run_tests + with: + use-tag: true + CHECKOUT_TOKEN: ${{ secrets.ENV_SECRET }} \ No newline at end of file