diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml new file mode 100644 index 0000000..0ebf85a --- /dev/null +++ b/.github/workflows/build-ubuntu.yml @@ -0,0 +1,89 @@ +name: Build Memory Cache Components + +on: + push: + branches: + - dev + pull_request: + branches: + - dev + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + with: + repository: 'johnshaughnessy/Memory-Cache-Browser-Client' + path: 'Memory-Cache-Browser-Client' + + - name: Install Node.js and Yarn + uses: actions/setup-node@v2 + with: + node-version: '18.18.2' + + - name: Install Memory Cache Browser Client Dependencies + run: | + cd Memory-Cache-Browser-Client + sudo corepack enable + yarn --version + yarn install + + - name: Build Memory Cache Browser Client + run: | + cd Memory-Cache-Browser-Client + yarn parcel build src/index.html + + - uses: actions/checkout@v2 + with: + repository: 'johnshaughnessy/Memory-Cache-Hub' + path: 'Memory-Cache-Hub' + + - name: Set up Python 3.11 + uses: actions/setup-python@v2 + with: + python-version: 3.11 + + # + # Caching does not seem to work: + # + # Unable to reserve cache with key 'Linux-python-'. + # + # So commenting out this step. + # + # name: Cache Python dependencies + # uses: actions/cache@v2 + # id: cache-python-deps + # with: + # path: | + # Memory-Cache-Hub/venv/ + # ~/.cache/pip + # key: ${{ runner.os }}-python-${{ hashFiles('Memory-Cache-Hub/requirements.txt') }} + # restore-keys: | + # ${{ runner.os }}-python- + + - name: Install Memory Cache Hub Dependencies + if: steps.cache-python-deps.outputs.cache-hit != 'true' + run: | + cd Memory-Cache-Hub + python3.11 -m venv venv + source venv/bin/activate + pip install -r requirements.txt + + - name: Build Memory Cache Hub + run: | + cd Memory-Cache-Hub + source venv/bin/activate + pip install -r requirements.build.txt + python3.11 -m memory_cache_hub.build.build_memory_cache_hub --client-path ../Memory-Cache-Browser-Client/dist + + - name: Zip the Memory Cache Hub Build + run: | + cd Memory-Cache-Hub/dist + zip -r memory_cache_hub.zip memory_cache_hub + + - name: Upload Memory Cache Hub Artifact + uses: actions/upload-artifact@v2 + with: + name: memory_cache_${{ runner.os }}_${{ github.sha }} + path: Memory-Cache-Hub/dist/memory_cache_hub.zip diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 8adce48..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Build Memory Cache Components - -on: - push: - branches: - - dev - pull_request: - branches: - - dev - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - # - uses: actions/checkout@v2 - # with: - # repository: 'johnshaughnessy/Memory-Cache-Browser-Client' - # path: 'Memory-Cache-Browser-Client' - - # - name: Install Node.js and Yarn - # uses: actions/setup-node@v2 - # with: - # node-version: '18.18.2' - - # - name: Install Memory Cache Browser Client Dependencies - # run: | - # cd Memory-Cache-Browser-Client - # sudo corepack enable - # yarn --version - # yarn install - - # - name: Build Memory Cache Browser Client - # run: | - # cd Memory-Cache-Browser-Client - # yarn parcel build src/index.html - - - uses: actions/checkout@v2 - with: - repository: 'johnshaughnessy/Memory-Cache-Hub' - path: 'Memory-Cache-Hub' - - - name: Set up Python 3.11 - uses: actions/setup-python@v2 - with: - python-version: 3.11 - - - name: Cache Python dependencies - uses: actions/cache@v2 - id: cache-python-deps - with: - path: | - Memory-Cache-Hub/venv/ - ~/.cache/pip - key: ${{ runner.os }}-python-${{ hashFiles('Memory-Cache-Hub/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-python- - - - name: Install Memory Cache Hub Dependencies - if: steps.cache-python-deps.outputs.cache-hit != 'true' - run: | - cd Memory-Cache-Hub - python3.11 -m venv venv - source venv/bin/activate - pip install -r requirements.txt - - # - name: Build Memory Cache Hub - # run: | - # cd Memory-Cache-Hub - # source venv/bin/activate - # pip install -r requirements.build.txt - # python3.11 -m memory_cache_hub.build.build_memory_cache_hub --client-path ../Memory-Cache-Browser-Client/dist - - # - name: Zip the Memory Cache Hub Build - # run: | - # cd Memory-Cache-Hub/dist - # zip -r memory_cache_hub.zip memory_cache_hub - - # - name: Upload Memory Cache Hub Artifact - # uses: actions/upload-artifact@v2 - # with: - # name: memory_cache_hub - # path: Memory-Cache-Hub/dist/memory_cache_hub.zip