Migrate to github actions #32
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
name: Run all checks on Kedro Starters | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
security-scan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{inputs.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install test requirements | |
run: make install-test-requirements | |
- name: Run Bandit | |
run: bandit -ll -r . | |
run-tests: | |
strategy: | |
matrix: | |
os: [ windows-latest ] | |
python-version: [ "3.8", "3.9", "3.10", "3.11" ] | |
runs-on: ${{ matrix.os }} | |
env: | |
HADOOP_HOME: 'C:\hadoop' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{inputs.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# - name: Install test requirements | |
# run: make install-test-requirements | |
# - name: Setup Java | |
# uses: actions/setup-java@v1 | |
# with: | |
# java-version: '11' | |
# - name: Setup spark | |
# uses: vemonet/setup-spark@v1 | |
# with: | |
# spark-version: '3.4.1' | |
# hadoop-version: | |
- name: Set the value | |
id: step_one | |
run: | | |
echo "action_state=yellow" >> $GITHUB_ENV | |
- name: Use the value | |
id: step_two | |
run: | | |
printf '%s\n' "$action_state" # This will output 'yellow' | |
- name: Set Env | |
run: | | |
echo "HADOOP_HOME=C:\hadoop" >> $GITHUB_ENV | |
echo "action_state=yellow" >> $GITHUB_ENV | |
- name: Run `kedro run` end to end tests for all starters | |
run: | | |
printf '%s\n' "$action_state" | |
printf '%s\n' "$HADOOP_HOME" | |
Invoke-WebRequest https://github.com/steveloughran/winutils/blob/master/hadoop-2.7.1/bin/winutils.exe?raw=true -OutFile winutils.exe | |
Invoke-WebRequest https://github.com/steveloughran/winutils/blob/master/hadoop-2.7.1/bin/hadoop.dll?raw=true -OutFile hadoop.dll | |
Move-Item .\hadoop.dll C:\Windows\System32 | |
New-Item -ItemType directory -Path C:\hadoop\bin | |
Move-Item .\winutils.exe C:\hadoop\bin | |
setx HADOOP_HOME=123 | |
set HADOOP_HOME=1234 | |
python -c "import os; print(os.environ.get('HADOOP_HOME'))" | |
python -c "from pathlib import Path; print(list(Path('C:\hadoop').iterdir()))" | |
# behave features/run.feature --tags=pyspark | |
lint: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
python-version: [ "3.8", "3.9", "3.10", "3.11" ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{inputs.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test requirements | |
run: make install-test-requirements | |
- name: Run linter for all starters | |
run: behave features/lint.feature |