turboBasic is testing out GitHub Actions 🚀 #205
Workflow file for this run
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
# yamllint disable rule:empty-lines | |
name: Verify | |
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**/*.md' | |
- .gitignore | |
- .github/** | |
- .idea/** | |
- .vscode/** | |
pull_request: | |
branches: | |
- main | |
jobs: | |
unit-and-integration-test: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- uses: actions/checkout@v4 | |
with: | |
clean: false | |
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "🖥️ The workflow is now ready to test your code on the runner." | |
- run: ls -AlF ${{ github.workspace }} | |
- run: ${{ github.workspace }}/dev all-test | |
- run: echo "🍏 This job's status is ${{ job.status }}." | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ls ${{ github.workspace }} | |
- run: mkdir -p build/image-cache | |
- id: image-cache | |
uses: actions/cache@v3 | |
with: | |
path: build/image-cache | |
key: docker-${{ runner.os }}-${{ hashFiles('Dockerfile', 'dev') }} | |
- if: steps.image-cache.outputs.cache-hit != 'true' | |
run: | | |
docker pull oxsecurity/megalinter-python:v7 | |
docker image save --output build/image-cache/megalinter.tar oxsecurity/megalinter-python:v7 | |
- if: steps.image-cache.outputs.cache-hit == 'true' | |
run: docker image load --input build/image-cache/megalinter.tar | |
- name: MegaLinter | |
id: ml | |
# You can override MegaLinter flavor used to have faster performances | |
# More info at https://megalinter.io/flavors/ | |
uses: oxsecurity/megalinter/flavors/[email protected] | |
env: | |
# All available variables are described in documentation | |
# https://megalinter.io/configuration/ | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources | |
- run: docker image ls -a | |
- if: github.event_name == 'pull_request' | |
name: Setup Node for Commit Linter | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21.x | |
- if: github.event_name == 'pull_request' | |
run: npm install | |
- if: github.event_name == 'pull_request' | |
name: Validate all commits from PR | |
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to HEAD --verbose | |
# --to ${{ github.event.pull_request.head.sha }} |