diff --git a/.github/workflows/test.yml b/.github/workflows/build.yml similarity index 81% rename from .github/workflows/test.yml rename to .github/workflows/build.yml index f4bbd24..48b3f5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,7 @@ -name: 'build-test' +name: 'build' concurrency: group: ${{ github.head_ref || github.ref_name }} - cancel-in-progress: true on: pull_request: @@ -16,10 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: | - npm install - - run: | - npm run all + - run: npm install + - run: npm run all test: runs-on: ubuntu-latest @@ -83,3 +80,21 @@ jobs: - name: assert zero stacks run: EXPECTED_STACKS= npx ts-node assert-stacks working-directory: pulumi + + check-dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Rebuild the dist/ directory + run: | + npm ci + npm run build + npm run package + - name: Compare the expected and actual dist/ directories + run: | + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + \ No newline at end of file diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml deleted file mode 100644 index f37e6df..0000000 --- a/.github/workflows/check-dist.yml +++ /dev/null @@ -1,53 +0,0 @@ -# `dist/index.js` is a special file in Actions. -# When you reference an action with `uses:` in a workflow, -# `index.js` is the code that will run. -# For our project, we generate this file through a build process from other source files. -# We need to make sure the checked-in `index.js` actually matches what we expect it to be. -name: Check dist/ - -on: - push: - branches: - - develop - paths-ignore: - - '**.md' - pull_request: - paths-ignore: - - '**.md' - workflow_dispatch: - -jobs: - check-dist: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set Node.js 16.x - uses: actions/setup-node@v3.5.1 - with: - node-version: 16.x - - - name: Install dependencies - run: npm ci - - - name: Rebuild the dist/ directory - run: | - npm run build - npm run package - - - name: Compare the expected and actual dist/ directories - run: | - if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. See status below:" - git diff - exit 1 - fi - id: diff - - # If index.js was different than expected, upload the expected version as an artifact - - uses: actions/upload-artifact@v2 - if: ${{ failure() && steps.diff.conclusion == 'failure' }} - with: - name: dist - path: dist/ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6d16fe8..d570b33 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,21 +1,9 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" on: push: branches: [ develop ] pull_request: - # The branches below must be a subset of the branches above branches: [ develop ] schedule: - cron: '31 7 * * 3' @@ -33,39 +21,19 @@ jobs: fail-fast: false matrix: language: [ 'TypeScript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - name: Checkout repository uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} source-root: src - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v1 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1