Add pre_condition for related cases. #125
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: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
CodeCheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Environment | |
run: | | |
sudo apt install -y python3 python3-pip python3-git python3-ply git shellcheck perl codespell | |
sudo mkdir -p /usr/share/codespell | |
sudo wget https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt -O /usr/share/codespell/dictionary.txt | |
sudo wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt -O /usr/bin/spelling.txt | |
sudo wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/const_structs.checkpatch -O /usr/bin/const_structs.checkpatch | |
sudo wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl -O /bin/checkpatch.pl | |
sudo chmod +x /bin/checkpatch.pl | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check Code | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
./.github/scripts/pr_check "origin/${{ github.base_ref }}" "${{ github.sha }}" | |
BuildCheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Environment | |
run: | | |
sudo apt remove docker docker-engine docker.io containerd runc -y | |
sudo apt install ca-certificates curl gnupg lsb-release -y | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt update | |
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build Docker Image | |
run: sudo docker build -f ./Dockerfile.build -t builder . | |
- name: Build Project | |
run: sudo ./.github/scripts/build_check |