|
8 | 8 | - master |
9 | 9 | pull_request: |
10 | 10 | jobs: |
11 | | - test-docker-image: |
12 | | - runs-on: ubuntu-latest |
13 | | - needs: build-docker-image |
14 | | - steps: |
15 | | - - uses: actions/checkout@v1 |
16 | | - - run: sed -i "s/master/sha-${GITHUB_SHA}/g" Dockerfile |
17 | | - - name: 'Wait for status checks' |
18 | | - id: waitforstatuschecks |
19 | | - uses: ./ |
20 | | - with: |
21 | | - ignoreActions: "test-docker-image,Create Release,Wait for status checks" |
22 | | - checkInterval: 1 |
23 | | - env: |
24 | | - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
25 | | - - run: | |
26 | | - echo "${{ steps.waitforstatuschecks.outputs.status }}" |
27 | | - exit 78 |
28 | | - if: steps.waitforstatuschecks.outputs.status != 'success' |
29 | 11 | composer-install: |
30 | 12 | runs-on: ubuntu-latest |
31 | 13 | container: |
|
97 | 79 | needs: |
98 | 80 | - generate-ref |
99 | 81 | - lint-dockerfile |
100 | | - - qa |
101 | 82 | runs-on: ubuntu-latest |
102 | 83 | steps: |
103 | 84 | - uses: actions/checkout@v3 |
@@ -125,7 +106,26 @@ jobs: |
125 | 106 | --password-stdin |
126 | 107 | - run: docker build --platform=linux/arm/v7,linux/arm64,linux/amd64 --output=type=registry --no-cache -t $(echo "ghcr.io/${GITHUB_REPOSITORY}:sha-${GITHUB_SHA}" | tr '[:upper:]' '[:lower:]') . -f Dockerfile-build |
127 | 108 | - run: docker pull $(echo "ghcr.io/${GITHUB_REPOSITORY}:sha-${GITHUB_SHA}" | tr '[:upper:]' '[:lower:]') |
128 | | - - run: docker run -v /tmp/trivy:/var/lib/trivy -v /var/run/docker.sock:/var/run/docker.sock -t aquasec/trivy:latest --cache-dir /var/lib/trivy image --exit-code 1 --no-progress --format table $(echo "ghcr.io/${GITHUB_REPOSITORY}:sha-${GITHUB_SHA}" | tr '[:upper:]' '[:lower:]') |
| 109 | +# - run: docker run -v /tmp/trivy:/var/lib/trivy -v /var/run/docker.sock:/var/run/docker.sock -t aquasec/trivy:latest --cache-dir /var/lib/trivy image --exit-code 1 --no-progress --format table $(echo "ghcr.io/${GITHUB_REPOSITORY}:sha-${GITHUB_SHA}" | tr '[:upper:]' '[:lower:]') |
129 | 110 | - run: | |
130 | 111 | printf "FROM %s" $(echo "ghcr.io/${GITHUB_REPOSITORY}:sha-${GITHUB_SHA}" | tr '[:upper:]' '[:lower:]') >> Dockerfile.tag |
131 | 112 | docker build --platform=linux/arm/v7,linux/arm64,linux/amd64 --output=type=registry --no-cache -f Dockerfile.tag -t $(echo "ghcr.io/${GITHUB_REPOSITORY}:${{ needs.generate-ref.outputs.ref }}" | tr '[:upper:]' '[:lower:]') . |
| 113 | + test-docker-image: |
| 114 | + runs-on: ubuntu-latest |
| 115 | + needs: build-docker-image |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v1 |
| 118 | + - run: sed -i "s/master/sha-${GITHUB_SHA}/g" Dockerfile |
| 119 | + - name: 'Wait for status checks' |
| 120 | + id: waitforstatuschecks |
| 121 | + uses: ./ |
| 122 | + with: |
| 123 | + ignoreActions: "test-docker-image,Create Release,Wait for status checks" |
| 124 | + checkInterval: 1 |
| 125 | + env: |
| 126 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 127 | + - name: "Assert Output: status is successful" |
| 128 | + uses: nick-fields/assert-action@v1 |
| 129 | + with: |
| 130 | + expected: success |
| 131 | + actual: ${{ steps.waitforstatuschecks.outputs.status }} |
0 commit comments