|
1 | 1 | name: CI
|
2 | 2 |
|
3 |
| -on: [push] |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' # Push events on all branches |
| 7 | + paths-ignore: |
| 8 | + - '.github/workflows/init.yml' |
| 9 | + tags: |
| 10 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 including semver |
4 | 11 |
|
5 | 12 | jobs:
|
| 13 | + |
6 | 14 | build_docs:
|
7 |
| - runs-on: ubuntu-latest |
| 15 | + runs-on: ubuntu-22.04 |
| 16 | + name: Build, Install, Package documentation |
| 17 | + if: "!contains(github.event.head_commit.message, 'docs skip')" |
8 | 18 | steps:
|
9 |
| - - uses: buildkite/trigger-pipeline-action@v1.2.0 |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - name: Install credentials |
| 21 | + run: echo https://$GITHUB_OAUTH:@github.com > $HOME/.git-credentials |
10 | 22 | env:
|
11 |
| - BUILDKITE_API_ACCESS_TOKEN: ${{ secrets.BUILDKITE_API_ACCESS_TOKEN }} |
12 |
| - PIPELINE: "feelpp/feelpp-docs" |
13 |
| - COMMIT: "HEAD" |
14 |
| - BRANCH: "master" |
15 |
| - MESSAGE: ":github: Triggered from a GitHub Action by Tutorial-Dev Project" |
16 |
| - build_examples: |
17 |
| - runs-on: ubuntu-20.04 |
| 23 | + GITHUB_OAUTH: ${{ secrets.CR_PAT_WORKFLOW }} |
| 24 | + - name: Build |
| 25 | + run: | |
| 26 | + npm install |
| 27 | + npm run antora |
| 28 | + working-directory: docs |
| 29 | + - name: Deploy |
| 30 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 31 | + with: |
| 32 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + BRANCH: gh-pages # The branch the action should deploy to. |
| 34 | + FOLDER: public # The folder the action should deploy. |
| 35 | + |
| 36 | + |
| 37 | + build_code: |
| 38 | + runs-on: self-ubuntu-22.04 |
| 39 | + name: Build, Install, Package code |
| 40 | + if: "!contains(github.event.head_commit.message, 'code skip')" |
18 | 41 | steps:
|
19 |
| - - uses: actions/checkout@v2 |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@v3 |
20 | 44 | with:
|
21 | 45 | lfs: true
|
22 |
| - - name: feelpp |
23 |
| - run: | |
24 |
| - echo "deb https://dl.bintray.com/feelpp/ubuntu focal stable" | sudo tee -a /etc/apt/sources.list |
25 |
| - wget -qO - https://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add - |
26 |
| - sudo apt update |
27 |
| - sudo apt install -y libfeelpp-dev feelpp-tools |
28 |
| - - name: antora |
| 46 | + recursive: true |
| 47 | + - |
| 48 | + name: Build |
29 | 49 | run: |
|
30 |
| - sudo npm i -g @antora/cli@2.3 @antora/site-generator-default@2.3 |
31 |
| - - name: Build Tutorial Dev |
| 50 | + cmake --preset default |
| 51 | + cmake --build --preset default |
| 52 | + - |
| 53 | + name: Check |
32 | 54 | run: |
|
33 |
| - mkdir build && cd build |
34 |
| - CXX=clang++-9 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install .. |
35 |
| - make |
36 |
| - make install |
37 |
| - - name: Ctest |
38 |
| - run: | |
39 |
| - ctest -R . |
40 |
| - working-directory: build |
41 |
| - - name: Package |
| 55 | + ctest --preset default |
| 56 | + env: |
| 57 | + OMPI_ALLOW_RUN_AS_ROOT: 1 |
| 58 | + OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 |
| 59 | + - |
| 60 | + name: Package |
42 | 61 | run: |
|
43 |
| - make package |
44 |
| - mkdir artifact && cp feelpp-tutorial-dev*.tar.gz artifact |
45 |
| - ls -l artifact |
46 |
| - tar tzvf feelpp-tutorial-dev*.tar.gz |
47 |
| - working-directory: build |
48 |
| -# - name: Upload artifact |
49 |
| -# uses: actions/upload-artifact@v1.0.0 |
50 |
| -# with: |
51 |
| -# # Artifact name |
52 |
| -# name: Tutorial Dev-${{ runner.os }} |
53 |
| -# # Directory containing files to upload |
54 |
| -# path: build/install/ |
| 62 | + cmake --build --preset default -t package |
| 63 | + - name: Upload Artifact |
| 64 | + uses: actions/upload-artifact@v3 |
| 65 | + with: |
| 66 | + # Artifact name |
| 67 | + name: feelpp-tutorial-dev-artifacts |
| 68 | + # Directory containing files to upload |
| 69 | + path: build/default/assets/feelpp-tutorial-dev-* |
| 70 | + - name: Release |
| 71 | + if: startsWith(github.ref ,'refs/tags/v') |
| 72 | + uses: softprops/action-gh-release@v1 |
| 73 | + with: |
| 74 | + files: build/default/assets/feelpp-tutorial-dev-* |
| 75 | + draft: false |
| 76 | + prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')}} |
| 77 | + name: Release ${{ github.ref_name }} |
| 78 | + generate_release_notes: true |
| 79 | + tag_name: ${{ github.ref }} |
| 80 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 81 | + deliver: |
| 82 | + runs-on: self-ubuntu-22.04 |
| 83 | + needs: build_code |
| 84 | + name: Build docker, tag and push |
| 85 | + |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v3 |
| 88 | + with: |
| 89 | + lfs: true |
| 90 | + submodules: 'recursive' |
| 91 | + - name: Download |
| 92 | + uses: actions/download-artifact@v3 |
| 93 | + with: |
| 94 | + # Artifact name |
| 95 | + name: feelpp-tutorial-dev-artifacts |
| 96 | + path: artifacts/ |
| 97 | + - |
| 98 | + name: Docker meta |
| 99 | + id: meta |
| 100 | + uses: docker/metadata-action@v4 |
| 101 | + with: |
| 102 | + images: | |
| 103 | + ghcr.io/feelpp/feelpp-tutorial-dev |
| 104 | + tags: | |
| 105 | + type=ref,event=branch |
| 106 | + type=ref,event=pr |
| 107 | + type=semver,pattern={{version}} |
| 108 | + type=semver,pattern={{major}}.{{minor}} |
| 109 | + - |
| 110 | + name: Set up QEMU |
| 111 | + uses: docker/setup-qemu-action@v2 |
| 112 | + - |
| 113 | + name: Set up Docker Buildx |
| 114 | + uses: docker/setup-buildx-action@v2 |
| 115 | + - |
| 116 | + name: Login to GitHub Container Registry |
| 117 | + uses: docker/login-action@v2 |
| 118 | + with: |
| 119 | + registry: ghcr.io |
| 120 | + username: ${{ github.repository_owner }} |
| 121 | + password: ${{ secrets.CR_PAT }} |
| 122 | + - |
| 123 | + name: Build container image |
| 124 | + uses: docker/build-push-action@v4 |
| 125 | + with: |
| 126 | + context: artifacts |
| 127 | + push: ${{ github.event_name != 'pull_request' }} |
| 128 | + tags: ${{ steps.meta.outputs.tags }} |
| 129 | + labels: ${{ steps.meta.outputs.labels }} |
| 130 | + file: ./Dockerfile |
| 131 | + |
0 commit comments