Skip to content

Commit

Permalink
Large Dependency / Actions Updates (#144)
Browse files Browse the repository at this point in the history
* feat: fresh start

* feat: package lock

* more update

* feat: update cimg base

* feat: commit dist

* documentation: update

* feat: remove codeql so I don't have to think about it in 5 months
  • Loading branch information
promiseofcake authored Aug 12, 2022
1 parent afddcb2 commit 88918a9
Show file tree
Hide file tree
Showing 16 changed files with 12,003 additions and 8,514 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
jobs:
output:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.08
steps:
- run: "echo this is an output build, the output_value is: << pipeline.parameters.output_value >>"

Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
14 changes: 8 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
# Check the npm registry for updates every day (weekdays)
- package-ecosystem: github-actions
directory: /
schedule:
interval: "daily"
interval: daily

- package-ecosystem: npm
directory: /
schedule:
interval: daily
51 changes: 51 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# `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:
- main
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/[email protected]
with:
node-version: 16.x

- name: Install dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: npm run prepare

- 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/
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '24 5 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# 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 }}
config-file: ./.github/codeql/codeql-config.yml
# 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
9 changes: 8 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ on:
pull_request:

jobs:
# compile
units:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci

# test action works running from the graph
test:
runs-on: ubuntu-latest
env:
OUTPUT_VALUE: overloaded output value
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
project-slug: ${{ github.repository }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
env:
OUTPUT_VALUE: overloaded output value
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Capture triggering branch name
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- uses: ./
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ parameters:
jobs:
output:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.08
steps:
- run: echo "this is an output build"

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ inputs:
required: true
default: '{}'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
Loading

0 comments on commit 88918a9

Please sign in to comment.