diff --git a/.github/workflows/foo.yaml b/.github/workflows/foo.yaml new file mode 100644 index 00000000..4a6b172e --- /dev/null +++ b/.github/workflows/foo.yaml @@ -0,0 +1,8 @@ +--- +name: foo +on: pull_request +jobs: + status-check: + runs-on: ubuntu-24.04 + steps: + - run: exit 0 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 776acba0..85ecf916 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,5 +2,96 @@ name: test on: pull_request jobs: + # test: + # uses: ./.github/workflows/wc-test.yaml status-check: - uses: ./.github/workflows/wc-test.yaml + runs-on: ubuntu-24.04 + # if: failure() + # needs: + # - test + steps: + - run: exit 1 + # after-status-check: + # runs-on: ubuntu-24.04 + # if: always() + # permissions: + # statuses: write + # checks: write + # needs: + # - status-check + # steps: + # - name: Create a check run (success) + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/check-runs" \ + # -f "name=status-check" \ + # -f "head_sha=$GITHUB_SHA" \ + # -f "status=completed" \ + # -f "conclusion=success" + # - name: Create a check run (success) + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/check-runs" \ + # -f "name=test / status-check (pull_request)" \ + # -f "head_sha=$GITHUB_SHA" \ + # -f "status=completed" \ + # -f "conclusion=success" + # - name: Update a check run (success) + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/check-runs" \ + # -f "name=test / status-check (pull_request)" \ + # -f "head_sha=$GITHUB_SHA" \ + # -f "status=completed" \ + # -f "conclusion=success" + # - name: Create a commit status (failure) + # env: + # GH_TOKEN: ${{github.token}} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + # -f "state=failure" \ + # -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + # -f "context=status-check" + # - name: Create a commit status (success) + # env: + # GH_TOKEN: ${{github.token}} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + # -f "state=success" \ + # -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + # -f "context=status-check" + # - name: Create a commit status (success) + # env: + # GH_TOKEN: ${{github.token}} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + # -f "state=success" \ + # -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + # -f "context=test / status-check (pull_request)" diff --git a/.github/workflows/wc-test.yaml b/.github/workflows/wc-test.yaml index 81cb55c7..bb6b7752 100644 --- a/.github/workflows/wc-test.yaml +++ b/.github/workflows/wc-test.yaml @@ -5,7 +5,7 @@ jobs: foo: runs-on: ubuntu-24.04 steps: - - run: test -n "$TEST_ENV" + - run: sleep 60 env: TEST_ENV: ${{vars.TEST_ENV}} bar: