diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..168226f44a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: GitHub CI + +on: + pull_request: + push: + schedule: + - cron: 0 0 * * 0 + +defaults: + run: + shell: 'bash -Eeuo pipefail -x {0}' + +jobs: + generate-jobs: + name: Generate Jobs + runs-on: ubuntu-latest + outputs: + strategy: ${{ steps.generate-jobs.outputs.strategy }} + steps: + - uses: actions/checkout@v2 + - id: generate-jobs + name: Generate Jobs + run: | + git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew + strategy="$(~/bashbrew/scripts/github-actions/generate.sh)" + strategy="$(~/bashbrew/scripts/github-actions/munge-i386.sh -c <<<"$strategy")" + jq . <<<"$strategy" # sanity check / debugging aid + echo "::set-output name=strategy::$strategy" + + test: + needs: generate-jobs + strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }} + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Prepare Environment + run: ${{ matrix.runs.prepare }} + - name: Pull Dependencies + run: ${{ matrix.runs.pull }} + - name: Build ${{ matrix.name }} + run: ${{ matrix.runs.build }} + - name: History ${{ matrix.name }} + run: ${{ matrix.runs.history }} + - name: Test ${{ matrix.name }} + run: ${{ matrix.runs.test }} + - name: '"docker images"' + run: ${{ matrix.runs.images }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index adfc34a9a1..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: bash -services: docker - -env: - - NAME=6.0 WORKDIR=stable/debian - - NAME=6.5 WORKDIR=fresh/debian -install: - - git clone https://github.com/docker-library/official-images.git ~/official-images - -before_script: - - env | sort - - cd "${WORKDIR}" - - image="varnish:${NAME}" - -script: - - travis_retry docker build -t "$image" . - - ~/official-images/test/run.sh "$image" - -after_script: - - docker images diff --git a/README.md b/README.md index fcd9bff44f..fd2b439f82 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,14 @@ -[![Build Status](https://travis-ci.org/varnish/docker-varnish.svg?branch=master)](https://travis-ci.org/varnish/docker-varnish) +[![GitHub CI build status badge](https://github.com/varnish/docker-varnish/workflows/GitHub%20CI/badge.svg)](https://github.com/varnish/docker-varnish/actions?query=workflow%3A%22GitHub+CI%22) + This is the source repository use to build the official [Varnish Docker image](https://hub.docker.com/_/varnish). diff --git a/populate.sh b/populate.sh index 056eb7635d..3e035611d5 100755 --- a/populate.sh +++ b/populate.sh @@ -103,46 +103,9 @@ populate_library() { done } -update_travis() { - name=$1 - workdir=`echo $CONFIG | jq -r ".[\"$1\"][\"workdir\"]"` - echo " - NAME=$name WORKDIR=$workdir" >> .travis.yml -} - -populate_travis(){ - cat > .travis.yml << EOF -language: bash -services: docker - -env: -EOF - - for i in `echo $CONFIG | jq -r 'keys | .[]'`; do - update_travis $i - done - - cat >> .travis.yml << EOF -install: - - git clone https://github.com/docker-library/official-images.git ~/official-images - -before_script: - - env | sort - - cd "\${WORKDIR}" - - image="varnish:\${NAME}" - -script: - - travis_retry docker build -t "\$image" . - - ~/official-images/test/run.sh "\$image" - -after_script: - - docker images -EOF -} - case "$1" in dockerfiles) populate_dockerfiles - populate_travis ;; library) populate_library