Skip to content

Commit

Permalink
Fork chores
Browse files Browse the repository at this point in the history
  • Loading branch information
placintaalexandru committed Nov 1, 2023
1 parent 88dc235 commit 1a3080d
Show file tree
Hide file tree
Showing 44 changed files with 13,598 additions and 6,900 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier",
"prettier/@typescript-eslint"
"prettier"
],
"rules": {
"@typescript-eslint/ban-ts-ignore": "off"
Expand Down
9 changes: 4 additions & 5 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
# This script can yield false positives in cases where you only make stylistic changes to the TypeScript code that don't result in changes to the compiled JavaScript code.
# It is your responsibility as a developer to then commit the changes with `git commit --no-verify` and simply skip this commit hook.

TS_FILES=$(git diff --staged --name-only | grep -c '\.ts$')
DIST_MODIFIED=$(git diff --staged --name-only | grep -c dist/index.js)
TS_FILES=$(git diff --staged --name-only | grep -c "src/")
DIST_MODIFIED=$(git diff --staged --name-only | grep -c "dist/index.js")

if [ $TS_FILES -gt 0 ] && [ $DIST_MODIFIED -eq 0 ] ; then
echo "You modified TypeScript files but apparently did not run 'npm run build'".
exit 1;
if [ "$TS_FILES" -gt 0 ] && [ "$DIST_MODIFIED" -eq 0 ] ; then
npm run build && git add dist/index.js
fi
20 changes: 20 additions & 0 deletions .github/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ref: https://docs.codecov.com/docs/codecovyml-reference
coverage:
range: 80..100
round: down
precision: 1
status:
# ref: https://docs.codecov.com/docs/commit-status
project:
default:
# Avoid false negatives
threshold: 2%

# Test files aren't important for coverage
ignore:
- "tests"

# Make comments less noisy
comment:
layout: "files"
require_changes: yes
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
# When a new version of action exists
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: npm
open-pull-requests-limit: 10
directory: /
schedule:
interval: weekly
ignore:
- dependency-name: "*"
# Ignore the patch and account for everything more important than minor
update-types:
- "version-update:semver-patch"
30 changes: 30 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
concurrency:
# Cancel old actions upon push
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
name: Lint check
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Lint check
run: npm run lint
73 changes: 0 additions & 73 deletions .github/workflows/ci.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/test_components_input.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI Test - components input
on:
push:
branches:
- main
pull_request:
jobs:
install_on_runner:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use myself
uses: ./
with:
toolchain: nightly
profile: minimal
override: true
# 2 components not included within the minimal profile
components: clippy, miri

- name: Test clippy exists
run: cargo clippy -V

- name: Test miri exists
run: cargo miri -V
install_in_docker:
runs-on: ubuntu-latest
# Docker image, not the GitHub Actions VM
container: ubuntu:latest
steps:
- name: Checkout
uses: actions/checkout@v4

# `rustup` will need `curl` or `wget` later
- name: Install packages
run: apt-get update && apt-get install -y curl

- name: Use myself
uses: ./
with:
toolchain: nightly
profile: minimal
override: true
# 2 components not included within the minimal profile
components: clippy, miri

- name: Test clippy exists
run: cargo clippy -V

- name: Test miri exists
run: cargo miri -V
60 changes: 60 additions & 0 deletions .github/workflows/test_default_input.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI Test - default input
on:
push:
branches:
- main
pull_request:
jobs:
install_on_runner:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
toolchain:
- 1.70.0
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use myself
id: toolchain
uses: ./
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
default: true

- name: Test toolchain version
run: |
test "${{ steps.toolchain.outputs.rustc }}" = "${{ matrix.toolchain }}"
install_in_docker:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- 1.70.0
# Docker image, not the GitHub Actions VM
container: ubuntu:latest
steps:
- name: Checkout
uses: actions/checkout@v4

# `rustup` will need `curl` or `wget` later
- name: Install packages
run: apt-get update && apt-get install -y curl

- name: Use myself
id: toolchain
uses: ./
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
default: true

- name: Test toolchain version
run: |
test "${{ steps.toolchain.outputs.rustc }}" = "${{ matrix.toolchain }}"
77 changes: 77 additions & 0 deletions .github/workflows/test_install_stable_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI Test - install stable & nightly
on:
push:
branches:
- main
pull_request:
jobs:
install_on_runner:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
toolchain:
- stable
- nightly
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use myself
id: toolchain
uses: ./
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true

- name: Test action outputs
env:
RUSTC: ${{ steps.toolchain.outputs.rustc }}
RUSTC_HASH: ${{ steps.toolchain.outputs.rustc_hash }}
CARGO: ${{ steps.toolchain.outputs.cargo }}
RUSTUP: ${{ steps.toolchain.outputs.rustup }}
run: |
echo "$RUSTC" && test "$RUSTC" != ""
echo "$RUSTC_HASH" && test "$RUSTC_HASH" != ""
echo "$CARGO" && test "$CARGO" != ""
echo "$RUSTUP" && test "$RUSTUP" != ""
install_in_docker:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- nightly
# Docker image, not the GitHub Actions VM
container: ubuntu:latest
steps:
- name: Checkout
uses: actions/checkout@v4

# `rustup` will need `curl` or `wget` later
- name: Install packages
run: apt-get update && apt-get install -y curl

- name: Use myself
id: toolchain
uses: ./
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true

- name: Test action outputs
env:
RUSTC: ${{ steps.toolchain.outputs.rustc }}
RUSTC_HASH: ${{ steps.toolchain.outputs.rustc_hash }}
CARGO: ${{ steps.toolchain.outputs.cargo }}
RUSTUP: ${{ steps.toolchain.outputs.rustup }}
run: |
echo "$RUSTC" && test "$RUSTC" != ""
echo "$RUSTC_HASH" && test "$RUSTC_HASH" != ""
echo "$CARGO" && test "$CARGO" != ""
echo "$RUSTUP" && test "$RUSTUP" != ""
Loading

0 comments on commit 1a3080d

Please sign in to comment.