diff --git a/.github/deploy_sofa.yaml b/.github/deploy_sofa.yaml new file mode 100644 index 0000000..b16db02 --- /dev/null +++ b/.github/deploy_sofa.yaml @@ -0,0 +1,74 @@ +name: Caravel-SOFA_HD Deployment + +# = = = Env Variable = = = = = +# secrets.TEST_REPO_KEY +# secrets.SOFA_HD_KEY +# secrets.SOFA_CHD_KEY +# secrets.QLSOFA_HD_KEY +# secrets.QLAP3_KEY +# yq r -X deploy_sofa.yaml > ./workflows/deploy_sofa_hd.yaml + +env: + SCAN_DIRECTORY: &SCAN_DIRECTORY + 'FPGA1212_FLAT_HD_SKY_PNR/**' + PROJ_SUFFIX: &PROJ_SUFFIX + SOFA_HD + DEST_DIR: &DEST_DIR + Caravel-SOFA_HD + DEST_REPO: &DEST_REPO + lnis-uofu/actions_test_repo + REPO_KEY: &REPO_KEY + ${{ secrets.TEST_REPO_KEY }} + +on: + push: + paths: + - '.github/**' + - '$SCAN_DIRECTORY' + pull_request: + types: closed + branches: + - master +jobs: + linux: + name: Updating release repository + runs-on: ubuntu-latest + steps: + - name: Checkout SOFA-Chips + uses: actions/checkout@v2 + with: + path: SOFA-Chips + + - name: Checkout caravel repo + uses: actions/checkout@master + with: + repository: *DEST_REPO + path: *DEST_DIR + + - name: Checkout open_mpw_precheck repo + uses: actions/checkout@master + with: + repository: efabless/open_mpw_precheck + path: open_mpw_precheck + + - name: Perform checks with open_mpw_precheck + uses: addnab/docker-run-action@v1 + with: + image: goreganesh/open_mpw_prechecker + options: -v ${{github.workspace}}:/usr/local/workspace -w /usr/local/workspace + run: bash ./SOFA-Chips/.github/workflows/perform_precheck.sh + + - name: Deploy files + run: bash ./SOFA-Chips/.github/workflows/sync_repo.sh + + - name: Deploy Changes + uses: peaceiris/actions-gh-pages@v3 + with: + user_name: "lnis.uofu" + user_email: "lnis.uofu@gmail.com" + deploy_key: *REPO_KEY + external_repository: *DEST_REPO + publish_dir: *DEST_DIR + publish_branch: master + disable_nojekyll: true + commit_message: '[Deployment] ${{ github.event.head_commit.message }}' diff --git a/.github/workflows/deploy_repo.yaml b/.github/workflows/deploy_repo.yaml deleted file mode 100644 index 77e31ac..0000000 --- a/.github/workflows/deploy_repo.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: To perform precheck and deploy to release repository - -on: - push: - pull_request: - types: closed - branches: - - master -jobs: - linux: - name: Updating release repository - runs-on: ubuntu-latest - steps: - - name: Checkout SOFA-Chips - uses: actions/checkout@v2 - with: - path: SOFA-Chips - - - name: Checkout Caravel-SOFA-HD - uses: actions/checkout@master - with: - repository: lnis-uofu/actions_test_repo - path: Caravel-SOFA-HD - - - name: Where am I - uses: addnab/docker-run-action@v1 - with: - image: goreganesh/open_mpw_prechecker - options: -v ${{github.workspace}}:/usr/local/workspace - run: pwd && ls - - - name: Am I in the host container now - run: pwd && ls - - - name: Updating files - run: pwd && ls && cd SOFA-Chips && source ./.github/workflows/sync_repo.sh - - - name: View directory - run: pwd && ls - - - name: Deploy Changes - uses: peaceiris/actions-gh-pages@v3 - with: - user_name: "lnis.uofu" - user_email: "lnis.uofu@gmail.com" - deploy_key: ${{ secrets.TEST_REPO_KEY }} - external_repository: lnis-uofu/actions_test_repo - publish_dir: ./Caravel-SOFA-HD - publish_branch: master - disable_nojekyll: true - commit_message: '[Deployment] ${{ github.event.head_commit.message }}' diff --git a/.github/workflows/deploy_sofa_hd.yaml b/.github/workflows/deploy_sofa_hd.yaml new file mode 100644 index 0000000..63533bd --- /dev/null +++ b/.github/workflows/deploy_sofa_hd.yaml @@ -0,0 +1,61 @@ +name: Caravel-SOFA_HD Deployment +# = = = Env Variable = = = = = +# secrets.TEST_REPO_KEY +# secrets.SOFA_HD_KEY +# secrets.SOFA_CHD_KEY +# secrets.QLSOFA_HD_KEY +# secrets.QLAP3_KEY +# yq r -X deploy_sofa.yaml > ./workflows/deploy_sofa_hd.yaml +env: + SCAN_DIRECTORY: 'FPGA1212_FLAT_HD_SKY_PNR/**' + PROJ_SUFFIX: SOFA_HD + DEST_DIR: Caravel-SOFA_HD + DEST_REPO: lnis-uofu/actions_test_repo + REPO_KEY: ${{ secrets.TEST_REPO_KEY }} +on: + push: + paths: + - '.github/**' + - '$SCAN_DIRECTORY' + pull_request: + types: closed + branches: + - master +jobs: + linux: + name: Updating release repository + runs-on: ubuntu-latest + steps: + - name: Checkout SOFA-Chips + uses: actions/checkout@v2 + with: + path: SOFA-Chips + - name: Checkout caravel repo + uses: actions/checkout@master + with: + repository: lnis-uofu/actions_test_repo + path: Caravel-SOFA_HD + - name: Checkout open_mpw_precheck repo + uses: actions/checkout@master + with: + repository: efabless/open_mpw_precheck + path: open_mpw_precheck + - name: Perform checks with open_mpw_precheck + uses: addnab/docker-run-action@v1 + with: + image: goreganesh/open_mpw_prechecker + options: -v ${{github.workspace}}:/usr/local/workspace -w /usr/local/workspace + run: bash ./SOFA-Chips/.github/workflows/perform_precheck.sh + - name: Deploy files + run: bash ./SOFA-Chips/.github/workflows/sync_repo.sh + - name: Deploy Changes + uses: peaceiris/actions-gh-pages@v3 + with: + user_name: "lnis.uofu" + user_email: "lnis.uofu@gmail.com" + deploy_key: ${{ secrets.TEST_REPO_KEY }} + external_repository: lnis-uofu/actions_test_repo + publish_dir: Caravel-SOFA_HD + publish_branch: master + disable_nojekyll: true + commit_message: '[Deployment] ${{ github.event.head_commit.message }}' diff --git a/.github/workflows/perform_precheck.sh b/.github/workflows/perform_precheck.sh new file mode 100644 index 0000000..37920b5 --- /dev/null +++ b/.github/workflows/perform_precheck.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Working directory in github workspace +# Original repo is places ../SOFA-Chips +# for conditional file copy use PROJ_SUFFIX (example SOFA_HD) + +echo "=============================================" +echo " Not Implemented yet " +echo "=============================================" +pwd +ls +ls */* + +# MAGTYPE=mag magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull merge.tcl + + +# use fpga_top fpga_top_uut +# transform 1 0 0 0 1 0 +# box 0 0 2500 3000 \ No newline at end of file diff --git a/.github/workflows/sync_repo.sh b/.github/workflows/sync_repo.sh index c4f8a19..1f3e365 100644 --- a/.github/workflows/sync_repo.sh +++ b/.github/workflows/sync_repo.sh @@ -1,10 +1,19 @@ +#!/bin/bash +# This script runs after the prechecks and before the deployment +# In the host enviroment (All the GITHUB variables are available) -date >> ../Caravel-SOFA-HD/test_log_file.txt +# Working directory in github workspace +# Original repo is places SOFA-Chips +# for conditional file copy use PROJ_SUFFIX (example SOFA_HD) +tail -n +2 ./SOFA-Chips/SynRepoConfig/sync_files.csv | while IFS=, read -r srcLoc dstLoc; do + Copying "./SOFA-Chips/$srcLoc --> ${DEST_DIR}/$dstLoc" + rsync -avp ./SOFA-Chips/$srcLoc ${DEST_DIR}/$dstLoc +done -# MAGTYPE=mag magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull merge.tcl +cd ${DEST_DIR} - -# use fpga_top fpga_top_uut -# transform 1 0 0 0 1 0 -# box 0 0 2500 3000 \ No newline at end of file +[ -s source_commit_hash.txt ] || echo "----------" > source_commit_hash.txt +sed -i -e "s/^/\n/" source_commit_hash.txt +sed -i -e "s/^/${GITHUB_SHA}\n/" source_commit_hash.txt +sed -i -e "s/^/$(date)\n/" source_commit_hash.txt diff --git a/README.md b/README.md index b7a4b0a..3b24f9d 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,4 @@ Otherwise, you should provide full path using the option _--openfpga\_root\_path * Note: - Please **ONLY** place folders under this directory. README should be the **ONLY** file under this directory - - Each EDA tool should have **independent** workspace in separated directories + - Each EDA tool should have **independent** workspace in separated directories. diff --git a/SynRepoConfig/sync_files.csv b/SynRepoConfig/sync_files.csv new file mode 100644 index 0000000..71ffd96 --- /dev/null +++ b/SynRepoConfig/sync_files.csv @@ -0,0 +1,2 @@ +SrcLoc, DestLoc +FPGA1212_FLAT_HD_SKY_PNR/FPGA1212_FLAT_HD_SKY_task/,OpenFPGA_task