summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/main.yaml40
-rw-r--r--.github/workflows/update-base.yaml57
2 files changed, 52 insertions, 45 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 1eddf8f43c..988bf3b07e 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -10,6 +10,12 @@
## Also once the windows runner supports WSL we should implement
## support for building Erlang/OTP here.
##
+## When ghcr.io support using the GITHUB_TOKEN we should migrate
+## over to use it instead as that should allow us to use the
+## built-in caching mechanisms of docker/build-push-action@v2.
+## However as things are now we use docker directly to make things
+## work.
+##
name: Build and check Erlang/OTP
@@ -62,20 +68,35 @@ jobs:
uses: actions/download-artifact@v2
with:
name: otp_git_archive
- ## We need to login to the package registry in order to pull
- ## the base debian image.
- name: Docker login
- run: docker login https://docker.pkg.github.com -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
+ uses: docker/login-action@v1
+ with:
+ registry: docker.pkg.github.com
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ - name: Calculate BASE image
+ id: base
+ run: |
+ BASE_TAG=$(grep "^FROM" .github/dockerfiles/Dockerfile.${{ matrix.type }} | head -1 | awk '{print $2}')
+ echo "::set-output name=BASE_TAG::${BASE_TAG}"
+ .github/scripts/base-tag "${BASE_TAG}"
+ - name: Pull BASE image
+ run: docker pull ${{ steps.base.outputs.BASE_TAG }}
+ - name: Build BASE image
+ run: |
+ docker build --pull --tag ${{ steps.base.outputs.BASE_TAG }} \
+ --cache-from ${{ steps.base.outputs.BASE_TAG }} \
+ --file .github/dockerfiles/Dockerfile.${{ steps.base.outputs.BASE_TYPE }} \
+ --build-arg BASE=${{ steps.base.outputs.BASE }} .
- name: Build ${{ matrix.type }} image
run: |
- docker build -t otp --build-arg ARCHIVE=otp_src.tar.gz \
- -f .github/dockerfiles/Dockerfile.${{ matrix.type }} .
+ docker build --tag otp --file .github/dockerfiles/Dockerfile.${{ matrix.type }} \
+ --build-arg ARCHIVE=otp_src.tar.gz .
## Smoke build tests
- if: matrix.type == '32-bit' || matrix.type == '64-bit' || matrix.type == 'cross-compile'
name: Run smoke test
- run: |
- docker run -v $PWD/scripts:/scripts otp "cd /tests && /scripts/run-smoke-tests"
+ run: docker run -v $PWD/scripts:/scripts otp "cd /tests && /scripts/run-smoke-tests"
## Documentation checks
- if: matrix.type == 'documentation'
@@ -162,7 +183,7 @@ jobs:
name: otp_doc_man
## We add the correct version name into the file names
- ## and create the MD5 file for all assets
+ ## and create the hash files for all assets
- name: Create pre-build and doc archives
run: |
mkdir artifacts
@@ -177,12 +198,13 @@ jobs:
run: |
scripts/bundle-otp ${{ steps.tag.outputs.tag }}
- ## Create md5sum
+ ## Create hash files
- name: Create pre-build and doc archives
run: |
shopt -s nullglob
cd artifacts
md5sum {*.tar.gz,*.txt} > MD5.txt
+ sha256sum {*.tar.gz,*.txt} > SHA256.txt
- name: Upload pre-built and doc tar archives
uses: softprops/action-gh-release@v1
diff --git a/.github/workflows/update-base.yaml b/.github/workflows/update-base.yaml
index ed250262e7..6cf2eafac2 100644
--- a/.github/workflows/update-base.yaml
+++ b/.github/workflows/update-base.yaml
@@ -9,48 +9,33 @@ on:
## Build base images to be used by other github workflows
jobs:
- build-debian-64bit:
+ build:
+ name: Update base Erlang/OTP build images
if: github.repository == 'erlang/otp'
runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Build and push 64-bit base image
- uses: docker/build-push-action@v1
- with:
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- registry: docker.pkg.github.com
- dockerfile: .github/dockerfiles/Dockerfile.debian-base
- repository: erlang/otp/debian-base
- tags: latest
- build-debian-32bit:
- if: github.repository == 'erlang/otp'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Build and push 32-bit base image
- uses: docker/build-push-action@v1
- with:
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- registry: docker.pkg.github.com
- dockerfile: .github/dockerfiles/Dockerfile.debian-base
- build_args: "BASE=i386/debian"
- repository: erlang/otp/i386-debian-base
- tags: latest
+ strategy:
+ matrix:
+ type: [debian-base,ubuntu-base,i386-debian-base]
- build-ubuntu-64bit:
- if: github.repository == 'erlang/otp'
- runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Build and push 64-bit base image
- uses: docker/build-push-action@v1
+ - name: Docker login
+ uses: docker/login-action@v1
with:
+ registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- registry: docker.pkg.github.com
- dockerfile: .github/dockerfiles/Dockerfile.ubuntu-base
- repository: erlang/otp/ubuntu-base
- tags: latest
+ - name: Calculate BASE image
+ id: base
+ run: |
+ echo "::set-output name=BASE_TAG::docker.pkg.github.com/erlang/otp/${{ matrix.type }}"
+ .github/scripts/base-tag "${{ matrix.type }}"
+ - name: Build base image
+ run: |
+ docker build --pull --tag ${{ steps.base.outputs.BASE_TAG }} \
+ --cache-from ${{ steps.base.outputs.BASE_TAG }} \
+ --file .github/dockerfiles/Dockerfile.${{ steps.base.outputs.BASE_TYPE }} \
+ --build-arg BASE=${{ steps.base.outputs.BASE }} .
+ - name: Push base image
+ run: docker push ${{ steps.base.outputs.BASE_TAG }}