From 4727acc914b4c227d43eaaaa06dd167374864086 Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Tue, 19 Jul 2022 17:35:18 -0500 Subject: Add example with GitHub Actions --- examples/github_actions.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 examples/github_actions.yml (limited to 'examples') diff --git a/examples/github_actions.yml b/examples/github_actions.yml new file mode 100644 index 0000000..dffd045 --- /dev/null +++ b/examples/github_actions.yml @@ -0,0 +1,27 @@ +name: Test requests-cache with GitHub Actions + +on: + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + # Persist the SQLite file created by requests-cache across workflow runs + - id: cache + uses: actions/cache@v3 + with: + path: example_cache.sqlite + key: none + + # Install and run basic requests-cache example + - run: pip install '.' + - run: python examples/basic_sessions.py + - run: python examples/basic_sessions.py + - run: test -f example_cache.sqlite && echo 'Cache file created' || echo 'Cache file missing' -- cgit v1.2.1