Skip to content

Commit

Permalink
Use the new docker image on PRs that change it (#4098)
Browse files Browse the repository at this point in the history
  • Loading branch information
past authored Nov 1, 2024
1 parent 72e9459 commit 03a444a
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 6 deletions.
88 changes: 85 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,107 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: lint
python_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: python_test
go_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: go_test
web_components_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: web_components_test
go_chrome_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: go_chrome_test
go_firefox_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: go_firefox_test
Expand Down Expand Up @@ -74,10 +140,26 @@ jobs:
- name: Set DOCKER_INSTANCE
run: echo "DOCKER_INSTANCE=wptd-dev-$(echo $RANDOM)" >> $GITHUB_ENV

- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .

# run only if Docker configuration was not changed
- if: steps.dockerchanges.outputs.dockerconf == 'false'
name: Fetch latest Docker image
run: docker pull "${DOCKER_IMAGE}"

- name: pre-installation
run: |
docker pull "${DOCKER_IMAGE}"
bash ./util/docker-dev/run.sh -d -q
run: bash ./util/docker-dev/run.sh -d -q

- name: run tests with "cloud" build tag
run: docker exec -t "${DOCKER_INSTANCE}" make go_cloud_test;
22 changes: 19 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,26 @@ jobs:
- name: Set DOCKER_INSTANCE
run: echo "DOCKER_INSTANCE=wptd-dev-$(echo $RANDOM)" >> $GITHUB_ENV

- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .

# run only if Docker configuration was not changed
- if: steps.dockerchanges.outputs.dockerconf == 'false'
name: Fetch latest Docker image
run: docker pull "${DOCKER_IMAGE}"

- name: pre-installation
run: |
docker pull "${DOCKER_IMAGE}"
bash ./util/docker-dev/run.sh -d -q
run: bash ./util/docker-dev/run.sh -d -q

- name: installation
run: docker exec -t "${DOCKER_INSTANCE}" make go_build;
Expand Down

0 comments on commit 03a444a

Please sign in to comment.