diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml new file mode 100644 index 00000000000..3e440635dda --- /dev/null +++ b/.github/workflows/ci-linux.yml @@ -0,0 +1,49 @@ +name: "ci-linux Docker image" + +on: + workflow_dispatch: + push: + branches: + - ci-linux + +env: + DOCKER_USER_OPTION: '$UID:$GID' + SCCACHE_GCS_BUCKET: 'composable-build-artefacts' + RUSTC_WRAPPER: "/home/runner/.cargo/bin/sccache" + SCCACHE_GCS_RW_MODE: "READ_WRITE" + +jobs: + build-and-publish: + runs-on: + - self-hosted + - linux + - x64 + - sre + concurrency: + group: docker-${{ github.ref }} + cancel-in-progress: true + strategy: + fail-fast: true + + steps: + - name: Clean up + continue-on-error: true + run: | + sudo chown -R $USER:$USER $GITHUB_WORKSPACE + docker system prune --force --all --volumes + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build Docker image + run: make containerize-ci-linux + + - name: Docker push + run: make push-ci-linux diff --git a/Makefile b/Makefile index 7279594898c..4535bfd89d9 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,14 @@ push-composable-sandbox: @docker push ${REPO}/composable-sandbox:${COMMIT_SHA} @docker push ${REPO}/composable-sandbox:latest +containerize-ci-linux: + @docker build -f docker/ci-linux.dockerfile \ + -t ${REPO}/ci-linux:production \ + . + +push-ci-linux: + @docker push ${REPO}/ci-linux:production + stop: @docker-compose down @@ -98,8 +106,8 @@ else endif -.PHONY: build test docs style-check lint udeps containerize dev push install stop containerize-release push-release containerize-composable-sandbox push-composable-sandbox - +.PHONY: build test docs style-check lint udeps containerize dev push install stop containerize-release push-release +.PHONY: containerize-composable-sandbox push-composable-sandbox containerize-ci-linux push-ci-linux #---------------------------------------------------------------------- # UTILITY FUNCTIONS TO remove diff --git a/docker/ci-linux.dockerfile b/docker/ci-linux.dockerfile new file mode 100644 index 00000000000..32034a0c56c --- /dev/null +++ b/docker/ci-linux.dockerfile @@ -0,0 +1,7 @@ +FROM paritytech/ci-linux:production + +RUN rustup toolchain uninstall nightly-2021-11-08 && \ + rustup toolchain uninstall nightly && \ + rustup toolchain install nightly-2021-11-29 && \ + rustup target install wasm32-unknown-unknown --toolchain nightly-2021-11-29 && \ + ln -s "${RUSTUP_HOME}/toolchains/nightly-2021-11-29-x86_64-unknown-linux-gnu" "${RUSTUP_HOME}/toolchains/nightly-x86_64-unknown-linux-gnu"