Automate changelog upon release and add pre-commit hook. #1
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: check | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: "*" | |
jobs: | |
check: | |
name: check | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Validate package.json | |
run: | | |
node -e "JSON.parse(require('fs').readFileSync('package.json','utf8'))" | |
- name: Clear Yarn Cache | |
run: yarn cache clean | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
- name: Audit Dependencies | |
run: yarn audit | |
continue-on-error: true | |
- name: Test Project | |
run: yarn run test | |
- name: Check liniting | |
run: yarn run lint:ci | |
continue-on-error: true | |
- name: Build Project | |
run: yarn run build | |
- name: Download ScanCode Toolkit | |
run: | | |
curl -L -o scancode-toolkit.tar.gz https://github.com/aboutcode-org/scancode-toolkit/releases/download/v32.3.0/scancode-toolkit-v32.3.0_py3.12-linux.tar.gz | |
mkdir -p scancode-toolkit | |
tar -xzf scancode-toolkit.tar.gz -C scancode-toolkit --strip-components=1 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Run ScanCode | |
run: | | |
cd scancode-toolkit | |
./scancode --json-pp ../scancode-result.json ../ | |
- name: Upload ScanCode Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: scancode-results | |
path: scancode-result.json |