diff --git a/.ci-dockerfiles/aarch64-unknown-linux-ubuntu20.04-builder/Dockerfile b/.ci-dockerfiles/aarch64-unknown-linux-ubuntu20.04-builder/Dockerfile index 3466f041d1..f515b086a6 100644 --- a/.ci-dockerfiles/aarch64-unknown-linux-ubuntu20.04-builder/Dockerfile +++ b/.ci-dockerfiles/aarch64-unknown-linux-ubuntu20.04-builder/Dockerfile @@ -26,7 +26,10 @@ RUN apt-get update \ RUN curl --output cmake-3.25.1-linux-x86_64.sh https://cmake.org/files/v3.25/cmake-3.25.1-linux-x86_64.sh \ && sh cmake-3.25.1-linux-x86_64.sh --prefix=/usr/local --exclude-subdir +# needed for GitHub actions +RUN git config --global --add safe.directory /__w/ponyc/ponyc + # add user pony in order to not run tests as root -RUN useradd -ms /bin/bash -d /home/pony -g root pony +RUN useradd -u 1001 -ms /bin/bash -d /home/pony -g root pony USER pony WORKDIR /home/pony diff --git a/.ci-dockerfiles/x86-64-unknown-linux-ubuntu22.04-builder/Dockerfile b/.ci-dockerfiles/x86-64-unknown-linux-ubuntu22.04-builder/Dockerfile index ac9c16cc5c..8c0ab80b70 100644 --- a/.ci-dockerfiles/x86-64-unknown-linux-ubuntu22.04-builder/Dockerfile +++ b/.ci-dockerfiles/x86-64-unknown-linux-ubuntu22.04-builder/Dockerfile @@ -23,7 +23,10 @@ RUN apt-get update \ && apt-get -y clean \ && pip3 install cloudsmith-cli +# needed for GitHub actions +RUN git config --global --add safe.directory /__w/ponyc/ponyc + # add user pony in order to not run tests as root -RUN useradd -ms /bin/bash -d /home/pony -g root pony +RUN useradd -u 1001 -ms /bin/bash -d /home/pony -g root pony USER pony WORKDIR /home/pony diff --git a/.cirrus.yml b/.cirrus.yml index 9e4513b8c3..cee54ab401 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,12 +8,6 @@ task: timeout_in: 120m matrix: - - name: "x86-64 Linux glibc" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - DEBUGGER: lldb - name: "x86-64 Linux musl" container: image: ponylang/ponyc-ci-x86-64-unknown-linux-musl-builder:20220807 @@ -291,20 +285,6 @@ task: timeout_in: 120m matrix: - - name: "nightly: x86-64-unknown-linux-ubuntu20.04" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu20.04-builder:20230115 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu20.04-builder:20230115 - TRIPLE_VENDOR: unknown - TRIPLE_OS: linux-ubuntu20.04 - - name: "nightly: x86-64-unknown-linux-ubuntu22.04" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - TRIPLE_VENDOR: unknown - TRIPLE_OS: linux-ubuntu22.04 - name: "nightly: x86-64-unknown-linux-musl" container: image: ponylang/ponyc-ci-x86-64-unknown-linux-musl-builder:20220807 @@ -439,20 +419,6 @@ task: timeout_in: 120m matrix: - - name: "release: x86-64-unknown-linux-ubuntu20.04" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu20.04-builder:20230115 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu20.04-builder:20230115 - TRIPLE_VENDOR: unknown - TRIPLE_OS: linux-ubuntu20.04 - - name: "release: x86-64-unknown-linux-ubuntu22.04" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - TRIPLE_VENDOR: unknown - TRIPLE_OS: linux-ubuntu22.04 - name: "release: x86-64-unknown-linux-musl" container: image: ponylang/ponyc-ci-x86-64-unknown-linux-musl-builder:20220807 @@ -586,22 +552,6 @@ task: timeout_in: 120m matrix: - - name: "Stress Test: x86-64-unknown-linux-ubuntu22.04 [release]" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - TARGET: test-stress-release - DEBUGGER: lldb - - name: "Stress Test: x86-64-unknown-linux-ubuntu22.04 [debug]" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - TARGET: test-stress-debug - DEBUGGER: lldb - depends_on: - - "Stress Test: x86-64-unknown-linux-ubuntu22.04 [release]" - name: "Stress Test: x86-64-unknown-linux-musl [release]" container: image: ponylang/ponyc-ci-x86-64-unknown-linux-musl-builder:20220807 @@ -618,22 +568,6 @@ task: DEBUGGER: gdb depends_on: - "Stress Test: x86-64-unknown-linux-musl [release]" - - name: "Stress Test: x86-64-unknown-linux-ubuntu22.04 [cd] [release]" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - TARGET: test-stress-with-cd-release - DEBUGGER: lldb - - name: "Stress Test: x86-64-unknown-linux-ubuntu22.04 [cd] [debug]" - container: - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - environment: - IMAGE: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20220720 - TARGET: test-stress-with-cd-debug - DEBUGGER: lldb - depends_on: - - "Stress Test: x86-64-unknown-linux-ubuntu22.04 [cd] [release]" - name: "Stress Test: x86-64-unknown-linux-musl [cd] [release]" container: image: ponylang/ponyc-ci-x86-64-unknown-linux-musl-builder:20220807 diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml new file mode 100644 index 0000000000..1238877140 --- /dev/null +++ b/.github/workflows/nightlies.yml @@ -0,0 +1,56 @@ +name: Nightlies + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + x86_64-linux: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806 + name: x86-64-unknown-linux-ubuntu22.04 + triple-os: linux-ubuntu22.04 + triple-vendor: unknown + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu20.04-builder:20230807 + name: x86-64-unknown-linux-ubuntu20.04 + triple-os: linux-ubuntu20.04 + triple-vendor: unknown + + name: ${{ matrix.name }} + container: + image: ${{ matrix.image }} + options: --user pony + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Cache Libs + id: cache-libs + uses: actions/cache@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Libs + if: steps.cache-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 + - name: Nightly + run: bash .ci-scripts/x86-64-nightly.bash + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + TRIPLE_VENDOR: ${{ matrix.triple-vendor }} + TRIPLE_OS: ${{ matrix.triple-os }} + - name: Send alert on failure + if: ${{ failure() }} + uses: zulip/github-actions-zulip@35d7ad8e98444f894dcfe1d4e17332581d28ebeb + with: + api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} + email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} + organization-url: 'https://ponylang.zulipchat.com/' + to: notifications + type: stream + topic: ${{ github.repository }} scheduled job failure + content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed. diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2ce454e5f9..65950d434d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -75,3 +75,41 @@ jobs: - uses: actions/checkout@v2 - name: Verify CHANGELOG run: changelog-tool verify + + x86_64-linux: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806 + name: x86-64 Linux glibc + + name: ${{ matrix.name }} + container: + image: ${{ matrix.image }} + options: --user pony --cap-add=SYS_PTRACE --security-opt seccomp=unconfined + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Cache Libs + id: cache-libs + uses: actions/cache@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Libs + if: steps.cache-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 + - name: Configure Debug Runtime + run: make configure arch=x86-64 config=debug + - name: Build Debug Runtime + run: make build config=debug + - name: Test with Debug Runtime + run: make test-ci config=debug usedebugger='lldb' + - name: Configure Release Runtime + run: make configure arch=x86-64 config=release + - name: Build Release Runtime + run: make build config=release + - name: Test with Release Runtime + run: make test-ci config=release usedebugger='lldb' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..5068f2a515 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + tags: + - \d+.\d+.\d+ + +concurrency: release + +jobs: + # validation to assure that we should in fact continue with the release should + # be done here. the primary reason for this step is to verify that the release + # was started correctly by pushing a `release-X.Y.Z` tag rather than `X.Y.Z`. + pre-artefact-creation: + name: Tasks to run before artefact creation + runs-on: ubuntu-latest + steps: + - name: Checkout main + uses: actions/checkout@v3 + with: + ref: "main" + token: ${{ secrets.RELEASE_TOKEN }} + - name: Validate CHANGELOG + uses: ponylang/release-bot-action@0.6.1 + with: + entrypoint: pre-artefact-changelog-check + + x86_64-linux: + needs: + - pre-artefact-creation + + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806 + name: x86-64-unknown-linux-ubuntu22.04 + triple-os: linux-ubuntu22.04 + triple-vendor: unknown + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu20.04-builder:20230807 + name: x86-64-unknown-linux-ubuntu20.04 + triple-os: linux-ubuntu20.04 + triple-vendor: unknown + + name: ${{ matrix.name }} + container: + image: ${{ matrix.image }} + options: --user pony + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Cache Libs + id: cache-libs + uses: actions/cache@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Libs + if: steps.cache-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 + - name: Release + run: bash .ci-scripts/x86-64-release.bash + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + TRIPLE_VENDOR: ${{ matrix.triple-vendor }} + TRIPLE_OS: ${{ matrix.triple-os }} diff --git a/.github/workflows/stress-test-runtime.yml b/.github/workflows/stress-test-runtime.yml new file mode 100644 index 0000000000..38add0bda0 --- /dev/null +++ b/.github/workflows/stress-test-runtime.yml @@ -0,0 +1,60 @@ +name: Nightlies + +on: + schedule: + - cron: "30 2 * * *" + +jobs: + x86_64-linux: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806 + name: x86-64-unknown-linux-ubuntu22.04 [release] + target: test-stress-release + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806 + name: x86-64-unknown-linux-ubuntu22.04 [debug] + target: test-stress-debug + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806 + name: x86-64-unknown-linux-ubuntu22.04 [cd] [release] + target: test-stress-cd-release + - image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806 + name: x86-64-unknown-linux-ubuntu22.04 [cd] [debug] + target: test-stress-cd-debug + + name: ${{ matrix.name }} + container: + image: ${{ matrix.image }} + options: --user pony + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Cache Libs + id: cache-libs + uses: actions/cache@v3 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Libs + if: steps.cache-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 + - name: Configure Debug Runtime + run: make configure config=debug + - name: Build Debug Runtime + run: make build config=debug + - name: Run Stress Test + run: make ${{ matrix.target }} config=debug usedebugger='lldb' + - name: Send alert on failure + if: ${{ failure() }} + uses: zulip/github-actions-zulip@35d7ad8e98444f894dcfe1d4e17332581d28ebeb + with: + api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} + email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} + organization-url: 'https://ponylang.zulipchat.com/' + to: notifications + type: stream + topic: ${{ github.repository }} scheduled job failure + content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.