Odoo18-Base/.gitea/workflows/setup_native.yml
2025-01-14 18:43:35 +07:00

75 lines
2.3 KiB
YAML

name: Setup Native Action
on:
push:
branches:
- main
jobs:
setup_native:
runs-on: host
strategy:
matrix:
python:
- 3.12.7
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Clean up Virtual Environment by branch
run: ./setup/clean_up_virtualenvs.sh 0
- name: Create Virtual Environment
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv virtualenv ${{ matrix.python }} "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
- name: Activate Virtual Environment
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv activate "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
python --version # Confirm Python version
- name: Install dotenv
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv activate "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
pip install python-dotenv
- name: Setup
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv activate "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
make install
- name: Generate Config
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv activate "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
make gen_config
- name: Run Tests
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv activate "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
make run_test