name: Published plugins on: schedule: - cron: '10 6 * * *' workflow_dispatch: pull_request: paths: - '.github/workflows/published-plugins.yml' permissions: contents: read concurrency: group: published-plugins-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true defaults: run: shell: bash jobs: latest: name: npm latest against this Stim runs-on: ubuntu-latest timeout-minutes: 20 env: STIM_BIN: ${{ github.workspace }}/packages/stim-cli/bin/stim.mjs PLUGINS: '@stim-cli/plugin-exact @stim-cli/plugin-godot' steps: - uses: actions/checkout@v4 with: persist-credentials: false - uses: ./.github/actions/setup-stim - name: Point Stim at a scratch home and engine root run: | echo "STIM_HOME=$RUNNER_TEMP/stim-home" >> "$GITHUB_ENV" echo "STIM_ENGINE_ROOT=$RUNNER_TEMP/stim-engine" >> "$GITHUB_ENV" - name: Install the npm latest plugins with stim plugin add working-directory: ${{ runner.temp }} run: | for package in $PLUGINS; do node "$STIM_BIN" plugin add "$package" done - name: List both as npm installs of the latest version, turned on and loadable working-directory: ${{ runner.temp }} run: | node "$STIM_BIN" plugin list --json > plugins.json jq '.plugins[] | select(.install == "npm")' plugins.json for package in $PLUGINS; do latest=$(npm view "$package" version) echo "$package latest is $latest" jq -e --arg package "$package" --arg version "$latest" \ '.plugins | any(.package == $package and .install == "npm" and .version == $version and .accepted and .selectedBy == ["plugins"])' \ plugins.json done - name: Run the contract kit on each installed plugin working-directory: ${{ runner.temp }} run: | for package in $PLUGINS; do node "$STIM_BIN" plugin test "$package" done - name: Create a Godot and an Exact fixture working-directory: ${{ runner.temp }} run: | mkdir -p fixtures/godot fixtures/exact touch fixtures/godot/project.godot echo '{"name":"shop"}' > fixtures/exact/package.json echo '{"app":{"id":"com.example.shop"}}' > fixtures/exact/app.json touch fixtures/exact/exact.mjs - name: Load the Exact module through stim doctor working-directory: ${{ runner.temp }}/fixtures/exact run: | node "$STIM_BIN" doctor --json > "$RUNNER_TEMP/exact-doctor.json" jq '.findings' "$RUNNER_TEMP/exact-doctor.json" jq -e '.findings | any(.title == "Exact application")' "$RUNNER_TEMP/exact-doctor.json" - name: Detect both fixtures by plugin in stim status working-directory: ${{ runner.temp }} run: | (cd fixtures/godot && node "$STIM_BIN" ports get web) (cd fixtures/exact && node "$STIM_BIN" ports get web) node "$STIM_BIN" status > status.txt cat status.txt grep -F 'project: Godot (plugin @stim-cli/plugin-godot)' status.txt grep -F 'project: Exact (plugin @stim-cli/plugin-exact)' status.txt