Compare commits

...

16 Commits

Author SHA1 Message Date
b90f7052ec Return to 9 compress level, insufficient time reduction
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-20 13:27:06 +02:00
91ecbfe91e Remove retry from CI
Remove retry from CI

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-20 13:07:31 +02:00
228e4c18cc Update with better retry methods
Update with better retry methods

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-20 12:54:08 +02:00
7a4634c4f8 Merge pull request #694 from bensuperpc/fix_error
Fixed errors that can sometimes occur with the CI and Improve CI
2022-05-19 20:21:09 +02:00
96839c5789 Merge branch 'master' into fix_error 2022-05-19 15:56:23 +02:00
eda038eacf Merge pull request #695 from bensuperpc/update_ci_tests
Update CI tests
2022-05-19 15:42:43 +02:00
daad4d760d Merge pull request #691 from bensuperpc/update_licence
Update LICENSE copyright dates and add @bensuperpc
2022-05-19 14:56:49 +02:00
979104089a Merge pull request #692 from bensuperpc/update_contrib
Update CONTRIBUTING.md
2022-05-19 12:11:32 +02:00
7876c21e62 Add retry on deploy step
Add retry on deploy step

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-19 11:05:42 +02:00
c068180665 Add timeout on CI
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-19 01:27:21 +02:00
63514041f6 Fix error
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-19 01:20:36 +02:00
3d5142d6ad Fix error with CI
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-19 01:03:41 +02:00
a9dda23ae7 Merge commit 'e3084efc9368251eafbf1a290cfd1fd047c3aa05' into update_contrib 2022-05-18 14:52:09 +02:00
0fc1c34f29 Update CONTRIBUTING.md and README.md
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-18 14:48:03 +02:00
84d4b38037 Merge commit '8328c514c1628799a65797aa06fcb370ebe576aa' into Add_contrib 2022-05-18 14:29:58 +02:00
a5f1b3098a Update LICENSE copyright dates and add @bensuperpc
Update LICENSE copyright dates and add @bensuperpc

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-05-18 14:14:05 +02:00
4 changed files with 88 additions and 27 deletions

View File

@ -18,26 +18,35 @@ jobs:
name: base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 1
- name: build
run: make base
- name: test
run: make base.test
- name: archive base
run: |
mkdir -p cache
docker save dockcross/base:latest | xz -e9 -T0 > ./cache/base.tar.xz
- name: save base
uses: actions/upload-artifact@v3
with:
name: cache
path: ./cache
retention-days: 1
- name: deploy
if: github.ref == 'refs/heads/master'
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
docker image push dockcross/base --all-tags
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
docker image push dockcross/base --all-tags
image:
name: ${{ matrix.arch_name.image }}
@ -833,17 +842,26 @@ jobs:
cpython_arg: "",
}
steps:
- uses: actions/checkout@v3
- name: checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 1
- uses: actions/download-artifact@v3
with:
name: cache
path: ./cache
- name: load base
run: xz -d -k < ./cache/base.tar.xz | docker load
- name: build
run: make ${{ matrix.arch_name.image }}
- name: basic test
run: make ${{ matrix.arch_name.image }}.test
# Updated on 19/05/2022
- name: stockfish build test
if: ${{ matrix.arch_name.stockfish == 'yes' }}
@ -855,12 +873,14 @@ jobs:
cd ../..
rm -rf Stockfish
# Updated on 19/05/2022
- name: ninja build test
if: ${{ matrix.arch_name.ninja == 'yes' }}
run: |
git clone --depth 1 --branch v1.11.0 https://github.com/ninja-build/ninja.git
cd ninja
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.ninja_arg }}
# Updated on 19/05/2022
- name: openssl build test
if: ${{ matrix.arch_name.openssl == 'yes' }}
@ -873,6 +893,7 @@ jobs:
./../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} -j2
cd ..
rm -rf openssl
# Updated on 19/05/2022
- name: C build test
if: ${{ matrix.arch_name.C == 'yes' }}
@ -883,6 +904,7 @@ jobs:
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.C_arg }}
cd ..
rm -rf C
# Updated on 19/05/2022
- name: C-Plus-Plus build test
if: ${{ matrix.arch_name.C-Plus-Plus == 'yes' }}
@ -893,6 +915,7 @@ jobs:
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.C-Plus-Plus_arg }}
cd ..
rm -rf C-Plus-Plus
# Updated on 19/05/2022
- name: fmt build test
if: ${{ matrix.arch_name.fmt == 'yes' }}
@ -902,6 +925,7 @@ jobs:
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.fmt_arg }} -DFMT_DOC=OFF
cd ..
rm -rf fmt
# Updated on 19/05/2022
- name: cpython build test
if: ${{ matrix.arch_name.cpython == 'yes' }}
@ -912,8 +936,9 @@ jobs:
./../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} -j2
cd ..
rm -rf cpython
- name: deploy
if: github.ref == 'refs/heads/master'
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
docker image push dockcross/${{ matrix.arch_name.image }} --all-tags
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
docker image push dockcross/${{ matrix.arch_name.image }} --all-tags

View File

@ -189,7 +189,7 @@ Once this part is finished, there must be 3 files in the **linux-arm64** folder:
- **Dockerfile.in**, the docker file.
- **Toolchain.cmake**, the CMake file for the toolchains.
### Makefile and CI
### Makefile
For this last part, we will see how to add the image to the [Makefile](Makefile) and to a github action.
@ -198,14 +198,14 @@ You need to add the image/folder name (**linux-arm64**) to the **STANDARD_IMAGES
```make
# These images are built using the "build implicit rule"
STANDARD_IMAGES = android-arm android-arm64 android-x86 android-x86_64 \
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-m68k-uclibc linux-s390x linux-x64-tinycc \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-arm64-lts \
linux-armv7l-musl linux-armv7 linux-armv7a linux-armv7-lts linux-x86_64-full \
linux-mips linux-ppc64le linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
web-wasi \
windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-m68k-uclibc linux-s390x linux-x64-tinycc \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-arm64-lts \
linux-armv7l-musl linux-armv7 linux-armv7a linux-armv7-lts linux-x86_64-full \
linux-mips linux-ppc64le linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
web-wasi \
windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64
```
You need to add the image/folder name (**linux-arm64**) to the **GEN_IMAGES** variable in the [Makefile](Makefile):
@ -213,18 +213,54 @@ You need to add the image/folder name (**linux-arm64**) to the **GEN_IMAGES** va
```make
# Generated Dockerfiles.
GEN_IMAGES = android-arm android-arm64 \
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 linux-arm64-lts \
web-wasm web-wasi linux-mips windows-arm64 windows-armv7 \
windows-static-x86 windows-static-x64 windows-static-x64-posix \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
linux-armv7 linux-armv7a linux-armv7l-musl linux-armv7-lts linux-x86_64-full \
linux-armv6 linux-armv6-lts linux-armv6-musl \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-ppc64le linux-s390x \
linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 linux-arm64-lts \
web-wasm web-wasi linux-mips windows-arm64 windows-armv7 \
windows-static-x86 windows-static-x64 windows-static-x64-posix \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
linux-armv7 linux-armv7a linux-armv7l-musl linux-armv7-lts linux-x86_64-full \
linux-armv6 linux-armv6-lts linux-armv6-musl \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-ppc64le linux-s390x \
linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc
```
### Image building and testing
You can now start building the image:
```bash
make linux-arm64
```
When finished, you can test it:
```bash
make linux-arm64.test
```
If you want to go a little further in the tests:
```bash
docker run --rm linux-arm64 > ./linux-arm64
chmod +x ./linux-arm64
```
And then run the commands to build a project (you must be in the directory of your project to build):
```bash
./linux-arm64 make
```
With CMake + Ninja:
```bash
./linux-arm64 cmake -Bbuild -S. -GNinja
./linux-arm64 ninja -Cbuild
```
### CI (github action)
To finish, you have to add to [Github Action](.github/workflows/main.yml) the image/folder name:
```yml

View File

@ -1,4 +1,4 @@
Copyright (c) 2015, 2016, 2017, 2018 Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin
Copyright (c) 2015, 2016, 2017, 2018, 2021 Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin, Bensuperpc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -25,7 +25,7 @@ Cross compiling toolchains in Docker images.
## Examples
1. `dockcross make`: Build the *Makefile* in the current directory.
2. `dockcross cmake -Bbuild -H. -GNinja`: Run CMake with a build directory `./build` for a *CMakeLists.txt* file in the current directory and generate `ninja` build configuration files.
2. `dockcross cmake -Bbuild -S. -GNinja`: Run CMake with a build directory `./build` for a *CMakeLists.txt* file in the current directory and generate `ninja` build configuration files.
3. `dockcross ninja -Cbuild`: Run ninja in the `./build` directory.
4. `dockcross bash -c '$CC test/C/hello.c -o hello'`: Build the *hello.c* file with the compiler identified with the `CC` environmental variable in the build environment.
5. `dockcross bash`: Run an interactive shell in the build environment.