Merge pull request #196 from microsoft/suspendService #453
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/PR | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- validate/* | |
jobs: | |
check_cache: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- run: yarn install --check-cache # https://yarnpkg.com/features/zero-installs#does-it-have-security-implications | |
check_diff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: yarn | |
- run: yarn run build | |
- name: check for uncommitted changes | |
# Ensure no changes. | |
run: | | |
git add -A # Add all content if it exists | |
git diff --cached --exit-code --stat \ | |
|| (echo "##[error] found changed files after build. please 'yarn run build'" \ | |
"and check in all changes" \ | |
&& git diff --cached \ | |
&& exit 1) | |
test-ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: ./ | |
env: | |
# We re-specify all of the tokens as environment variables because in non-windows builds tokens cannot be passed as input. | |
REPO_TOKEN: ${{ github.token }} | |
SERVICE_TOKEN: ${{ secrets.RichCodeNavServiceTokenProd }} | |
CODEINDEX_FEED_TOKEN: ${{ secrets.CODEINDEX_FEED_TOKEN }} | |
with: | |
service-token: ${{ secrets.RichCodeNavServiceTokenProd }} | |
languages: typescript | |
repo-token: ${{ github.token }} | |
test-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: ./ | |
env: | |
REPO_TOKEN: ${{ github.token }} | |
SERVICE_TOKEN: ${{ secrets.RichCodeNavServiceTokenProd }} | |
CODEINDEX_FEED_TOKEN: ${{ secrets.CODEINDEX_FEED_TOKEN }} | |
with: | |
service-token: ${{ secrets.RichCodeNavServiceTokenProd }} | |
languages: typescript | |
repo-token: ${{ github.token }} |