Skip to content

Commit

Permalink
ARCH-130: new cache approach
Browse files Browse the repository at this point in the history
  • Loading branch information
finfa committed Oct 17, 2023
1 parent dcdfba4 commit 40a1a38
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build test image
uses: checkout-charlie/github-actions/build@main

- name: Build images
uses: checkout-charlie/github-actions/build@v2
with:
build_args: |
-e MY_SECRET=${{ secrets.MY_SECRET }} \
stage: testing
stages: test, dist #these reflect the stages in the dockerfile

- name: Run tests
uses: checkout-charlie/github-actions/run-tests@main
uses: checkout-charlie/github-actions/run-tests@v2
with:
static: yarn lint && yarn test:static
unit: yarn test:unit
functional: yarn test:functional
post: yarn test:coverage
image_stage: test # default

- name: Run E2E tests
uses: checkout-charlie/github-actions/run-tests@main
uses: checkout-charlie/github-actions/run-tests@v2
with:
e2e: yarn test:e2e # Will start a container
e2e_port: 3000 # Required only if the image exposes multiple ports
post: yarn test:coverage
e2e_port: 3000 # Required only if the image exposes multiple ports or is using cypress
docker_args: |
-e MY_SECRET=${{ secrets.MY_SECRET }} \
- name: Build dist image
uses: checkout-charlie/github-actions/build-image@main
with:
build_args: |
-e MY_SECRET=${{ secrets.MY_SECRET }} \
stage: production
env_file: .env.dist # mandatory
cypress_node_version: 14.x # Only if Cypress is used to run the E2E test

- name: Push to Humanitec
uses: checkout-charlie/github-actions/humanitec-push-image@main
uses: checkout-charlie/github-actions/humanitec-push-image@v2
with:
humanitec_token: ${{ secrets.HUMANITEC_TOKEN }}

Expand All @@ -71,7 +68,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Deploy PR deployment
uses: checkout-charlie/github-actions/deploy-pr@main
uses: checkout-charlie/github-actions/deploy-pr@v2
with:
humanitec_token: ${{ secrets.HUMANITEC_TOKEN }}
source_environment: << base-environment >> # source environment where to clone from
Expand All @@ -95,7 +92,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Delete PR deployment
uses: checkout-charlie/github-actions/undeploy-pr@main
uses: checkout-charlie/github-actions/undeploy-pr@v2
with:
humanitec_token: ${{ secrets.HUMANITEC_TOKEN }}
app_id: << app-id >> # app id on Humanitec
Expand All @@ -108,18 +105,18 @@ At the moment of writing Github doesn't allow composite actions to bubble up ste
Use the `run-tests` action multiple times if you want to display individual tests as steps in your workflow:

```yaml
- name: Static analysis
uses: checkout-charlie/github-actions/run-tests@main
- name: Run static analysis
uses: checkout-charlie/github-actions/run-tests@v2
with:
static: yarn test:lint

- name: Unit tests
uses: checkout-charlie/github-actions/run-tests@main
- name: Run unit tests
uses: checkout-charlie/github-actions/run-tests@v2
with:
unit: yarn test:unit

- name: E2E tests
uses: checkout-charlie/github-actions/run-tests@main
- name: Run E2E tests
uses: checkout-charlie/github-actions/run-tests@v2
with:
e2e: yarn test:e2e
docker_args: |
Expand Down
2 changes: 1 addition & 1 deletion run-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ runs:
shell: sh
- name: Prepare Cypress test
if: inputs.e2e != '' && inputs.cypress_node_version != ''
uses: actions/setup-node@v1 # needed for e2e tests (until containerized cypress is fixed)
uses: actions/setup-node@v3 # needed for e2e tests (until containerized cypress is fixed)
with:
node-version: ${{ inputs.cypress_node_version }}
- name: Run Cypress tests
Expand Down

0 comments on commit 40a1a38

Please sign in to comment.