-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build-docs workflow Add cache-dependencies workflow Update cleanup-firebase workflow Update ci workflow Update analyze workflow Update analyze workflow
- Loading branch information
Showing
8 changed files
with
156 additions
and
65 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: PDM & Dependencies | ||
description: Install PDM and dependencies | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: ./.github/actions/pdm | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
# --only-keep flag in case the environment is restored from a stale cache. | ||
run: pdm sync -d --only-keep |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: PDM | ||
description: Install PDM | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: "3.9" | ||
# Cache all dependencies installed from pdm.lock | ||
cache: true |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# The purpose of this workflow is to get more cache hits when other workflows build dependencies. | ||
# Github actions do not share caches between branches, except that all branches can pull results | ||
# from the default (main) branch. Therefore, this workflow runs on the main branch to keep the | ||
# latest dependencies cached for other branches to use. | ||
# Branches that change the dependencies will still get cache misses. | ||
name: Build and cache dependencies on main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/dependencies |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Make requirements files | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "pdm.lock" | ||
|
||
jobs: | ||
make-requirements: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/pdm | ||
|
||
- name: Generate requirements.txt | ||
shell: bash | ||
run: | | ||
case "${{ matrix.os }}" in | ||
"ubuntu-latest") | ||
export PLATFORM="linux" | ||
;; | ||
"macOS-latest") | ||
export PLATFORM="macos" | ||
;; | ||
"windows-latest") | ||
export PLATFORM="windows" | ||
;; | ||
esac | ||
rm -rf requirements/* | ||
mkdir -p requirements/$PLATFORM | ||
pdm requirements requirements/$PLATFORM/requirements.txt | ||
- name: Get platform variable | ||
id: platform | ||
shell: bash | ||
run: | | ||
case "${{ matrix.os }}" in | ||
"ubuntu-latest") | ||
echo "::set-output name=platform::linux" | ||
;; | ||
"macOS-latest") | ||
echo "::set-output name=platform::macos" | ||
;; | ||
"windows-latest") | ||
echo "::set-output name=platform::windows" | ||
;; | ||
esac | ||
- name: Upload requirements files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.platform.outputs.platform }}-requirements | ||
path: requirements/${{ steps.platform.outputs.platform }} | ||
|
||
open-PR: | ||
needs: [make-requirements] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download linux requirements files | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: linux-requirements | ||
path: requirements/linux | ||
|
||
- name: Download windows requirements files | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-requirements | ||
path: requirements/windows | ||
|
||
- name: Download macOS requirements files | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: macos-requirements | ||
path: requirements/macos | ||
|
||
- name: Clean-up CRLF | ||
shell: bash | ||
run: find requirements -type f -exec sed -i 's/\r//g' {} \; | ||
|
||
- name: Get timestamp | ||
id: timestamp | ||
run: echo "::set-output name=timestamp::$(date +'%Y-%m-%d_%H-%M')" | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
base: main | ||
title: admin/requirements-update_${{ steps.timestamp.outputs.timestamp }} | ||
body: Updating requirements.txt. | ||
|
||
Due to some [challenges](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs), | ||
with getting this PR to trigger the tests, please manually close and re-open this PR. | ||
branch: admin/requirements-update_${{ steps.timestamp.outputs.timestamp }} | ||
commit-message: Updating requirements.txt after change to `pdm.lock` was pushed to `main` | ||
delete-branch: true |