Integrate Artifact's tables #59
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: Create & Update DB | |
on: [pull_request, workflow_dispatch] | |
env: | |
CFDB_ARTIFACTS_PATH: ${{ github.workspace }}/harvested_artifacts | |
CFDB_DB_PATH: ${{ github.workspace }}/cf-database.db | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
path: cfdb | |
- name: Clone Feedstock Outputs | |
uses: actions/checkout@v3 | |
with: | |
repository: conda-forge/feedstock-outputs | |
path: feedstock-outputs | |
- name: Clone Artifacts (import_to_package_maps -- sparse) | |
uses: actions/checkout@v3 | |
with: | |
repository: regro/libcfgraph | |
path: libcfgraph | |
sparse-checkout: import_to_pkg_maps | |
fetch-depth: 1 | |
- name: Verify cloned repos | |
run: | | |
ls -lat ${{ github.workspace }}/cfdb | |
ls -lat ${{ github.workspace }}/feedstock-outputs | |
ls -lat ${{ github.workspace }}/libcfgraph | |
- name: Build environment | |
uses: ./cfdb/.github/actions/build-conda-env | |
with: | |
env_file: environment.yaml | |
- name: Install cfdb | |
run: | | |
pip install -e ${{ github.workspace }}/cfdb | |
- name: Retrieve previous DB table from artifacts | |
uses: actions/download-artifact@v3 | |
id: download | |
continue-on-error: true | |
with: | |
name: cfdb | |
path: ${{ github.workspace }} | |
# Add an extra step to decompress the tar file back to the original location | |
- name: Decompress DB file | |
# Only run if the artifact download was successful | |
if: steps.download.outcome == 'success' | |
run: | | |
tar -xf ${{ steps.download.outputs.download-path }} -C ${{ github.workspace }} | |
ls -lat | |
echo "Decompressed DB file" $(du -sh ${{ github.workspace }}/cf-database.db) | |
- name: Test cfdb | |
working-directory: ${{ github.workspace }}/cfdb | |
run: | | |
echo "Test cfdb installation :::::" $(pwd) | |
cfdb --help | |
ls -lat . | |
- name: Populate table of feedstock outputs and import to package maps | |
run: | | |
echo "Update feedstock outputs" | |
cfdb update-feedstock-outputs --path ${{ github.workspace }}/feedstock-outputs | |
echo "Update import Packages to maps" | |
cfdb update-import-to-package-maps --path ${{ github.workspace }}/libcfgraph/import_to_pkg_maps | |
du -sh $CFDB_DB_PATH | |
ls -lat | |
- name: Harvest Artifacts | |
run: | | |
echo "Harvest Artifacts from upstream" | |
cfdb harvest-packages-and-artifacts --path $CFDB_DB_PATH | |
du -sh $CFDB_ARTIFACTS_PATH | |
ls -lat | |
- name: Populate artifact and files tables | |
run: | | |
echo "Populate artifact and files tables" | |
cfdb update-artifacts --path $CFDB_ARTIFACTS_PATH | |
du -sh $CFDB_DB_PATH | |
ls -lat | |
# Add the compression step using tar and Zstd | |
- name: Compress DB file | |
run: | | |
ZSTD_NBTHREADS=4 ZSTD_CLEVEL=19 tar --zstd -cf ${{ github.workspace }}/cf-database.db.tar.zstd $CFDB_DB_PATH | |
echo "Compressed DB file" $(du -sh ${{ github.workspace }}/cf-database.db.tar.zstd) | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cfdb | |
path: ${{ github.workspace }}/cf-database.db.tar.zstd |